summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAlex Denisov <1101.debian@gmail.com>2015-07-23 21:53:13 +0000
committerAlex Denisov <1101.debian@gmail.com>2015-07-23 21:53:13 +0000
commit3cf8efd969897d30d9ccff3f1e0892fabb1a6ed0 (patch)
tree2926a2a8809954130938b45cf84297f11331aa47 /clang
parent2ad5d173cedce0df9dc93bc7a41220f1c19d2d78 (diff)
downloadbcm5719-llvm-3cf8efd969897d30d9ccff3f1e0892fabb1a6ed0.tar.gz
bcm5719-llvm-3cf8efd969897d30d9ccff3f1e0892fabb1a6ed0.zip
Add documentation for the objc_boxable attribute
llvm-svn: 243048
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Basic/Attr.td2
-rw-r--r--clang/include/clang/Basic/AttrDocs.td28
2 files changed, 29 insertions, 1 deletions
diff --git a/clang/include/clang/Basic/Attr.td b/clang/include/clang/Basic/Attr.td
index 753e42c950a..d3b45555738 100644
--- a/clang/include/clang/Basic/Attr.td
+++ b/clang/include/clang/Basic/Attr.td
@@ -1143,7 +1143,7 @@ def ObjCRuntimeName : Attr {
def ObjCBoxable : Attr {
let Spellings = [GNU<"objc_boxable">];
let Subjects = SubjectList<[Record], ErrorDiag, "ExpectedStructOrUnion">;
- let Documentation = [Undocumented];
+ let Documentation = [ObjCBoxableDocs];
}
def OptimizeNone : InheritableAttr {
diff --git a/clang/include/clang/Basic/AttrDocs.td b/clang/include/clang/Basic/AttrDocs.td
index deaabc19392..0aeef2c4ddc 100644
--- a/clang/include/clang/Basic/AttrDocs.td
+++ b/clang/include/clang/Basic/AttrDocs.td
@@ -492,6 +492,34 @@ can only be placed before an @protocol or @interface declaration:
}];
}
+def ObjCBoxableDocs : Documentation {
+ let Category = DocCatFunction;
+ let Content = [{
+Structs and unions marked with the ``objc_boxable`` attribute can be used
+with the Objective-C boxed expression syntax, ``@(...)``.
+
+**Usage**: ``__attribute__((objc_boxable))``. This attribute
+can only be placed on a declaration of a trivially-copyable struct or union:
+
+.. code-block:: objc
+
+ struct __attribute__((objc_boxable)) some_struct {
+ int i;
+ };
+ union __attribute__((objc_boxable)) some_union {
+ int i;
+ float f;
+ };
+ typedef struct __attribute__((objc_boxable)) _some_struct some_struct;
+
+ // ...
+
+ some_struct ss;
+ NSValue *boxed = @(ss);
+
+ }];
+}
+
def AvailabilityDocs : Documentation {
let Category = DocCatFunction;
let Content = [{
OpenPOWER on IntegriCloud