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 13:24:15 PST 2014


[Dropping Tyler, who is no longer at this address]

> On Nov 20, 2014, at 1:12 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
> 
> On Thu, Nov 20, 2014 at 3:59 PM, Douglas Gregor <dgregor at apple.com <mailto:dgregor at apple.com>> wrote:
>> 
>> 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;
> 
> Yoiks! Good catch, Doug. It seems we need a bit more test coverage. ;-)
> 
>> 
>> 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 :)
> 
> I will investigate, but what "things" does it break when you extend
> the bit field to three bits? I modified NumArgs : 15 (down one from
> 16) and SyntaxUsed : 3 (up one from 2), and all tests passed for me
> with MSVC on Windows (not that test coverage is the end-all, be-all).


… and it was apparently a bogeyman. Moving to three bits doesn’t actually break anything.

	- Doug

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


More information about the cfe-commits mailing list