Skip to content

Commit 058486c

Browse files
egorzhdancompnerd
andauthored
[APINotes] Update the documentation with new features
This adds the documentation for a few recently added Clang API Notes features: C++ namespaces, `SwiftImportAs` and `SwiftCopyable`. --------- Co-authored-by: Saleem Abdulrasool <[email protected]>
1 parent 66a9e26 commit 058486c

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

clang/docs/APINotes.rst

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ entries:
8080

8181
Name: MyFramework
8282

83-
:Classes, Protocols, Tags, Typedefs, Globals, Enumerators, Functions:
83+
:Classes, Protocols, Tags, Typedefs, Globals, Enumerators, Functions, Namespaces:
8484

8585
Arrays of top-level declarations. Each entry in the array must have a
86-
'Name' key with its Objective-C name. "Tags" refers to structs, enums, and
87-
unions; "Enumerators" refers to enum cases.
86+
'Name' key with its Objective-C or C++ name. "Tags" refers to structs,
87+
C++ classes, enums, and unions; "Classes" refers to Objective-C classes;
88+
"Enumerators" refers to enum cases.
8889

8990
::
9091

@@ -157,6 +158,36 @@ declaration kind), all of which are optional:
157158
- Class: NSBundle
158159
SwiftName: Bundle
159160

161+
:SwiftImportAs:
162+
163+
For a class, possible values are ``owned`` (equivalent to
164+
``SWIFT_SELF_CONTAINED``) or ``reference`` (equivalent to
165+
``SWIFT_SHARED_REFERENCE``, also requires specifying ``SwiftReleaseOp`` and
166+
``SwiftRetainOp``).
167+
168+
For a method, possible values are ``unsafe`` (equivalent
169+
to ``SWIFT_RETURNS_INDEPENDENT_VALUE``) or ``computed_property`` (equivalent to
170+
``SWIFT_COMPUTED_PROPERTY``).
171+
172+
::
173+
174+
Tags:
175+
- Name: RefCountedStorage
176+
SwiftImportAs: reference
177+
SwiftReleaseOp: RCRelease
178+
SwiftRetainOp: RCRetain
179+
180+
:SwiftCopyable:
181+
182+
Allows annotating a C++ class as non-copyable in Swift. Equivalent to
183+
``SWIFT_NONCOPYABLE``, or to an explicit conformance ``: ~Copyable``.
184+
185+
::
186+
187+
Tags:
188+
- Name: tzdb
189+
SwiftCopyable: false
190+
160191
:Availability, AvailabilityMsg:
161192

162193
A value of "nonswift" is equivalent to ``NS_SWIFT_UNAVAILABLE``. A value of

0 commit comments

Comments
 (0)