aboutsummaryrefslogtreecommitdiff
path: root/clang/docs
diff options
context:
space:
mode:
authorEgor Zhdan <e_zhdan@apple.com>2024-06-12 13:12:57 +0100
committerGitHub <noreply@github.com>2024-06-12 13:12:57 +0100
commit058486c9e8820efee748f946fa773b56c4654feb (patch)
tree96e6a5133ed8bac6fd44670c370f1526042e5c47 /clang/docs
parent66a9e26438cbb5c547fd348a428ef3d1e775360c (diff)
downloadllvm-058486c9e8820efee748f946fa773b56c4654feb.zip
llvm-058486c9e8820efee748f946fa773b56c4654feb.tar.gz
llvm-058486c9e8820efee748f946fa773b56c4654feb.tar.bz2
[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 <compnerd@compnerd.org>
Diffstat (limited to 'clang/docs')
-rw-r--r--clang/docs/APINotes.rst37
1 files changed, 34 insertions, 3 deletions
diff --git a/clang/docs/APINotes.rst b/clang/docs/APINotes.rst
index a6e200e..bc09b16 100644
--- a/clang/docs/APINotes.rst
+++ b/clang/docs/APINotes.rst
@@ -80,11 +80,12 @@ entries:
Name: MyFramework
-:Classes, Protocols, Tags, Typedefs, Globals, Enumerators, Functions:
+:Classes, Protocols, Tags, Typedefs, Globals, Enumerators, Functions, Namespaces:
Arrays of top-level declarations. Each entry in the array must have a
- 'Name' key with its Objective-C name. "Tags" refers to structs, enums, and
- unions; "Enumerators" refers to enum cases.
+ 'Name' key with its Objective-C or C++ name. "Tags" refers to structs,
+ C++ classes, enums, and unions; "Classes" refers to Objective-C classes;
+ "Enumerators" refers to enum cases.
::
@@ -157,6 +158,36 @@ declaration kind), all of which are optional:
- Class: NSBundle
SwiftName: Bundle
+:SwiftImportAs:
+
+ For a class, possible values are ``owned`` (equivalent to
+ ``SWIFT_SELF_CONTAINED``) or ``reference`` (equivalent to
+ ``SWIFT_SHARED_REFERENCE``, also requires specifying ``SwiftReleaseOp`` and
+ ``SwiftRetainOp``).
+
+ For a method, possible values are ``unsafe`` (equivalent
+ to ``SWIFT_RETURNS_INDEPENDENT_VALUE``) or ``computed_property`` (equivalent to
+ ``SWIFT_COMPUTED_PROPERTY``).
+
+ ::
+
+ Tags:
+ - Name: RefCountedStorage
+ SwiftImportAs: reference
+ SwiftReleaseOp: RCRelease
+ SwiftRetainOp: RCRetain
+
+:SwiftCopyable:
+
+ Allows annotating a C++ class as non-copyable in Swift. Equivalent to
+ ``SWIFT_NONCOPYABLE``, or to an explicit conformance ``: ~Copyable``.
+
+ ::
+
+ Tags:
+ - Name: tzdb
+ SwiftCopyable: false
+
:Availability, AvailabilityMsg:
A value of "nonswift" is equivalent to ``NS_SWIFT_UNAVAILABLE``. A value of