[PATCH] Cleaning up __has_attribute without changing it

Aaron Ballman aaron at aaronballman.com
Thu Mar 27 13:26:04 PDT 2014


On Thu, Mar 27, 2014 at 4:09 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> LGTM

Thanks! Committed in r204952

~Aaron
>
>
> On Thu, Mar 27, 2014 at 12:20 PM, Aaron Ballman <aaron at aaronballman.com>
> wrote:
>>
>> This patch cleans up the __has_attribute implementation, but does not
>> modify its behavior. This is a partial application of the patch
>> discussed in
>> http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-March/036130.html
>>
>> This patch replaces the tablegen-driven AttrSpellings.inc, which lived
>> in the lexing layer with AttrHasAttributeImpl.inc, which lives in the
>> basic layer. It then updates the preprocessor to call through to this
>> new functionality which can take additional information into account
>> (such as scopes and syntaxes). It exposes the ability for parts of the
>> compiler to ask whether an attribute is supported for a given spelling
>> (including scope), syntax, triple and language options.
>>
>> To be clear: this patch is not intended to change the behavior of
>> __has_attribute. Passing AttrSyntax::Generic ensures that the current
>> behavior matches the previous implementation in that it *only*
>> considers the attribute's name and triple, not the scope or language
>> options. This is why there are no additional test cases supplied with
>> the patch.
>>
>> ~Aaron
>
>



More information about the cfe-commits mailing list