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

Duncan P. N. Exon Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 27 11:07:31 PDT 2016


> On 2016-Jun-27, at 11:02, Aaron Ballman <aaron.ballman at gmail.com> wrote:
> 
> 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).

It looks like it's already bloated for MSVC because of `InvalidBase`.  I
think that should be cleaned up in a prep commit.

> 
> 
> http://reviews.llvm.org/D21453
> 
> 
> 



More information about the cfe-commits mailing list