[PATCH] D21453: Add support for attribute "overallocated"

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 27 11:02:43 PDT 2016


aaron.ballman requested changes to this revision.
aaron.ballman added a comment.
This revision now requires changes to proceed.

Missing Sema tests for the attribute.


================
Comment at: include/clang/Basic/AttrDocs.td:2082
@@ +2081,3 @@
+
+struct S {
+  char a[4], char b[4];
----------------
I *think* this code example will give doxygen fits because it's not indented; have you tried generating the docs locally? You can test this by running: `clang-tblgen -gen-attr-docs -I E:\llvm\llvm\tools\clang\include E:\llvm\llvm\tools\clang\include\clang\Basic\Attr.td -o E:\llvm\llvm\tools\clang\docs\AttributeReference.rst` and then building the docs as normal. Note, you will have to revert AttributeReference.rst when you are done.

================
Comment at: lib/AST/ExprConstant.cpp:1051-1057
@@ -1050,4 +1050,9 @@
     CharUnits Offset;
     bool InvalidBase : 1;
-    unsigned CallIndex : 31;
+
+    // Indicates the enclosing struct is marked overallocated. This is used in
+    // computation of __builtin_object_size.
+    bool OverAllocated : 1;
+
+    unsigned CallIndex : 30;
     SubobjectDesignator Designator;
----------------
All three of these should be using `unsigned`, otherwise you do not get the behavior you expect in MSVC (it allocates bit-fields of different types on their own boundaries).


http://reviews.llvm.org/D21453





More information about the cfe-commits mailing list