[llvm-branch-commits] [cfe-branch] r243112 - Merging r243048:

Hans Wennborg hans at hanshq.net
Fri Jul 24 08:57:40 PDT 2015


Author: hans
Date: Fri Jul 24 10:57:40 2015
New Revision: 243112

URL: http://llvm.org/viewvc/llvm-project?rev=243112&view=rev
Log:
Merging r243048:
------------------------------------------------------------------------
r243048 | alexdenisov | 2015-07-23 14:53:13 -0700 (Thu, 23 Jul 2015) | 1 line

Add documentation for the objc_boxable attribute
------------------------------------------------------------------------

Modified:
    cfe/branches/release_37/   (props changed)
    cfe/branches/release_37/include/clang/Basic/Attr.td
    cfe/branches/release_37/include/clang/Basic/AttrDocs.td

Propchange: cfe/branches/release_37/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jul 24 10:57:40 2015
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:242244,242285,242293,242297,242313,242382,242422,242499,242574,242660,242662,242667,242678,242766,242905,243018
+/cfe/trunk:242244,242285,242293,242297,242313,242382,242422,242499,242574,242660,242662,242667,242678,242766,242905,243018,243048
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_37/include/clang/Basic/Attr.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_37/include/clang/Basic/Attr.td?rev=243112&r1=243111&r2=243112&view=diff
==============================================================================
--- cfe/branches/release_37/include/clang/Basic/Attr.td (original)
+++ cfe/branches/release_37/include/clang/Basic/Attr.td Fri Jul 24 10:57:40 2015
@@ -1133,7 +1133,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 {

Modified: cfe/branches/release_37/include/clang/Basic/AttrDocs.td
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_37/include/clang/Basic/AttrDocs.td?rev=243112&r1=243111&r2=243112&view=diff
==============================================================================
--- cfe/branches/release_37/include/clang/Basic/AttrDocs.td (original)
+++ cfe/branches/release_37/include/clang/Basic/AttrDocs.td Fri Jul 24 10:57:40 2015
@@ -492,6 +492,34 @@ can only be placed before an @protocol o
     }];
 }
 
+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 = [{





More information about the llvm-branch-commits mailing list