https://github.com/egorzhdan created https://github.com/llvm/llvm-project/pull/95162
This adds the documentation for a few recently added Clang API Notes features: C++ namespaces, `SwiftImportAs` and `SwiftCopyable`. >From c9d9d115118471f0ca6a311e44b366ef9fe4fb2b Mon Sep 17 00:00:00 2001 From: Egor Zhdan <e_zh...@apple.com> Date: Tue, 11 Jun 2024 19:58:53 +0100 Subject: [PATCH] [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`. --- clang/docs/APINotes.rst | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/clang/docs/APINotes.rst b/clang/docs/APINotes.rst index a6e200e8bffde..2a688e3dca24d 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``), ``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``), ``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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits