Skip to content

Commit c1cc39a

Browse files
committed
[Clang importer] Rely on Clang's mapping of API notes to attributes directly.
Rather than managing API notes directly in the Clang importer, tell Clang where to find the API notes files and let it map them directly to attributes. Then, use the existing attribute-mapping mechanisms---with minor extensions for cases where Clang previously didn't map some Swift-specific API notes---to get at that information. There is a minor regression where we can no longer apply API notes to declarations that don't have a specific Clang declaration. The specific example (NSError's inherited init()) comes from rdar://problem/21042412; we've regressed here, but the correct fix is (and has always been) on the Objective-C side (rdar://problem/19977891). Finishes rdar://problem/24447420.
1 parent 70bda7c commit c1cc39a

File tree

8 files changed

+39
-565
lines changed

8 files changed

+39
-565
lines changed

apinotes/Dispatch.apinotes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name: Dispatch
22
Functions:
33
- Name: dispatch_release
4-
Availability: none
4+
Availability: nonswift
55
- Name: dispatch_retain
6-
Availability: none
6+
Availability: nonswift

apinotes/Foundation.apinotes

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,8 @@ Classes:
1010
Methods:
1111
- Selector: 'decodeObjectOfClass:forKey:'
1212
MethodKind: Instance
13-
Availability: none
13+
Availability: nonswift
1414
AvailabilityMsg: use generic 'decodeObjectOfClass(_:forKey:)'
15-
- Name: NSError
16-
Methods:
17-
- Selector: 'init'
18-
MethodKind: Instance
19-
Availability: none
20-
AvailabilityMsg: use 'init(domain:code:userInfo:)'
2115
- Name: NSProcessInfo
2216
Methods:
2317
- Selector: processInfo

apinotes/ObjectiveC.apinotes

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Classes:
2323
NullabilityOfRet: N
2424
- Selector: class
2525
MethodKind: Class
26-
Availability: none
26+
Availability: nonswift
2727
AvailabilityMsg: use 'self' instead
2828
- Selector: 'conformsToProtocol:'
2929
MethodKind: Class
@@ -35,7 +35,7 @@ Classes:
3535
NullabilityOfRet: N
3636
- Selector: dealloc
3737
MethodKind: Instance
38-
Availability: none
38+
Availability: nonswift
3939
AvailabilityMsg: use 'deinit' to define a de-initializer
4040
- Selector: debugDescription
4141
MethodKind: Class
@@ -50,22 +50,22 @@ Classes:
5050
NullabilityOfRet: O
5151
- Selector: 'forwardInvocation:'
5252
MethodKind: Instance
53-
Availability: none
53+
Availability: nonswift
5454
- Selector: init
5555
MethodKind: Instance
5656
NullabilityOfRet: N
5757
DesignatedInit: true
5858
- Selector: 'instanceMethodSignatureForSelector:'
5959
MethodKind: Class
60-
Availability: none
60+
Availability: nonswift
6161
- Selector: 'isSubclassOfClass:'
6262
MethodKind: Class
6363
Nullability:
6464
- N
6565
NullabilityOfRet: S
6666
- Selector: 'methodSignatureForSelector:'
6767
MethodKind: Instance
68-
Availability: none
68+
Availability: nonswift
6969
- Selector: mutableCopy
7070
MethodKind: Instance
7171
NullabilityOfRet: N
@@ -90,7 +90,7 @@ Protocols:
9090
Methods:
9191
- Selector: class
9292
MethodKind: Instance
93-
Availability: none
93+
Availability: nonswift
9494
AvailabilityMsg: use 'dynamicType' instead
9595
- Selector: 'conformsToProtocol:'
9696
MethodKind: Instance

0 commit comments

Comments
 (0)