[PATCH] Cleaning up __has_attribute without changing it

Richard Smith richard at metafoo.co.uk
Thu Mar 27 13:09:19 PDT 2014


LGTM


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140327/015a6807/attachment.html>


More information about the cfe-commits mailing list