4 Commits

Author SHA1 Message Date
Anders Waldenborg
1285a495d5 [clang][pp] Handle attributes defined by plugin in __has_attribute
When using attributes by plugins (both in clang and clang-tidy) the
preprocessor functions `__has_attribute`, `__has_c_attribute`,
`__has_cpp_attribute` still returned 0.

That problem is fixed by having the "hasAttribute" function also check
if any of the plugins provide that attribute.

This also adds C2x spelling to the example plugin for attributes so that
`__has_c_attribute` can be tested.

Differential Revision: https://reviews.llvm.org/D144405
2023-03-13 16:47:51 +01:00
Yafei Liu
b2ba6867ea Refactoring the attribute plugin example to fit the new API
Make the example compile and the test case pass.
2020-12-21 08:24:09 -05:00
Benjamin Kramer
e8743c0f38 Const-initialize ParsedAttrInfos
Gets rid of a 150k static initializer (Release clang)
2020-03-28 19:04:53 +01:00
John Brawn
3f03c12a51 Add an attribute plugin example
Differential Revision: https://reviews.llvm.org/D31343
2020-03-25 14:33:44 +00:00