r210925 - Adds a Pragma spelling for attributes to tablegen and makes use of it for loop

Douglas Gregor dgregor at apple.com
Thu Nov 20 12:59:57 PST 2014


> On Jun 13, 2014, at 10:57 AM, Tyler Nowicki <tnowicki at apple.com> wrote:
> Modified: cfe/trunk/include/clang/Sema/AttributeList.h
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/AttributeList.h?rev=210925&r1=210924&r2=210925&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Sema/AttributeList.h (original)
> +++ cfe/trunk/include/clang/Sema/AttributeList.h Fri Jun 13 12:57:25 2014
> @@ -80,7 +80,9 @@ public:
>     /// __declspec(...)
>     AS_Declspec,
>     /// __ptr16, alignas(...), etc.
> -    AS_Keyword
> +    AS_Keyword,
> +    /// #pragma ...
> +    AS_Pragma
>   };


Amusingly, this new enumerator overflows the bitfield used to store the Syntax value:

  /// The number of expression arguments this attribute has.
  /// The expressions themselves are stored after the object.
  unsigned NumArgs : 15;

  /// Corresponds to the Syntax enum.
  unsigned SyntaxUsed : 2;

Yet more amusingly, extending this bit-ield to three bits breaks things, as does replacing the one source of AS_Syntax attributes with AS_GNU :)

	- Doug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141120/2a854390/attachment.html>


More information about the cfe-commits mailing list