This repository was archived by the owner on Mar 28, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +81
-5
lines changed
test/APINotes/Inputs/Frameworks Expand file tree Collapse file tree 5 files changed +81
-5
lines changed Original file line number Diff line number Diff line change @@ -396,14 +396,20 @@ bool APINotesManager::loadCurrentModuleAPINotes(
396
396
};
397
397
398
398
if (module ->IsFramework ) {
399
- // For frameworks, we search in the "APINotes" subdirectory.
399
+ // For frameworks, we search in the "Headers" or "PrivateHeaders"
400
+ // subdirectory.
400
401
llvm::SmallString<128 > path;
401
402
path += module ->Directory ->getName ();
402
- llvm::sys::path::append (path, " APINotes" );
403
- if (auto apinotesDir = fileMgr.getDirectory (path)) {
403
+ unsigned pathLen = path.size ();
404
+
405
+ llvm::sys::path::append (path, " Headers" );
406
+ if (auto apinotesDir = fileMgr.getDirectory (path))
404
407
tryAPINotes (apinotesDir, /* wantPublic=*/ true );
405
- tryAPINotes (apinotesDir, /* wantPublic=*/ false );
406
- }
408
+
409
+ path.resize (pathLen);
410
+ llvm::sys::path::append (path, " PrivateHeaders" );
411
+ if (auto privateAPINotesDir = fileMgr.getDirectory (path))
412
+ tryAPINotes (privateAPINotesDir, /* wantPublic=*/ false );
407
413
} else {
408
414
tryAPINotes (module ->Directory , /* wantPublic=*/ true );
409
415
tryAPINotes (module ->Directory , /* wantPublic=*/ false );
Original file line number Diff line number Diff line change
1
+ Name: SomeKit
2
+ Classes:
3
+ - Name: A
4
+ Methods:
5
+ - Selector: "transform:"
6
+ MethodKind: Instance
7
+ Availability: none
8
+ AvailabilityMsg: "anything but this"
9
+ - Selector: "transform:integer:"
10
+ MethodKind: Instance
11
+ NullabilityOfRet: N
12
+ Nullability: [ N, S ]
13
+ Properties:
14
+ - Name: intValue
15
+ PropertyKind: Instance
16
+ Availability: none
17
+ AvailabilityMsg: "wouldn't work anyway"
18
+ - Name: nonnullAInstance
19
+ PropertyKind: Instance
20
+ Nullability: N
21
+ - Name: nonnullAClass
22
+ PropertyKind: Class
23
+ Nullability: N
24
+ - Name: nonnullABoth
25
+ Nullability: N
26
+ - Name: B
27
+ Availability: none
28
+ AvailabilityMsg: "just don't"
29
+ - Name: C
30
+ Methods:
31
+ - Selector: "initWithA:"
32
+ MethodKind: Instance
33
+ DesignatedInit: true
34
+ SwiftVersions:
35
+ - Version: 3.0
36
+ Classes:
37
+ - Name: A
38
+ Methods:
39
+ - Selector: "transform:integer:"
40
+ MethodKind: Instance
41
+ NullabilityOfRet: O
42
+ Nullability: [ O, S ]
Original file line number Diff line number Diff line change
1
+ @interface A (ExplicitNullabilityProperties)
2
+ @property (nonatomic , readwrite , retain , nonnull ) A *explicitNonnullInstance;
3
+ @property (nonatomic , readwrite , retain , nullable ) A *explicitNullableInstance;
4
+ @end
5
+
Original file line number Diff line number Diff line change
1
+ Name: SomeKit
2
+ Classes:
3
+ - Name: A
4
+ Methods:
5
+ - Selector: "privateTransform:input:"
6
+ MethodKind: Instance
7
+ NullabilityOfRet: N
8
+ Nullability: [ N, S ]
9
+ Properties:
10
+ - Name: internalProperty
11
+ Nullability: N
12
+ Protocols:
13
+ - Name: InternalProtocol
14
+ Availability: none
15
+ AvailabilityMsg: "not for you"
Original file line number Diff line number Diff line change
1
+ Name: SomeOtherKit
2
+ Classes:
3
+ - Name: A
4
+ Methods:
5
+ - Selector: "methodA"
6
+ MethodKind: Instance
7
+ Availability: none
8
+ AvailabilityMsg: "anything but this"
You can’t perform that action at this time.
0 commit comments