Commit Graph

6 Commits

Author SHA1 Message Date
Aaron Ballman ac77dcd764 Allow a double-underscore spelling of Clang attributes using double square bracket syntax.
This matches a similar behavior with GCC accepting [[gnu::__attr__]] as a alias for [[gnu::attr]] in that clang attributes can now be spelled with two leading and trailing underscores.

I had always intended for this to work, but missed the critical bit. We already had an existing test in test/Preprocessor/has_attribute.cpp for [[clang::__fallthrough__]] but using that spelling would still give an "unknown attribute" diagnostic.

llvm-svn: 346547
2018-11-09 19:37:18 +00:00
Aaron Ballman c44c174246 Introduce the _Clang scoped attribute token.
Currently, we only accept clang as the scoped attribute identifier for double square bracket attributes provided by Clang, but this has the potential to conflict with user-defined macros. To help alleviate these concerns, this introduces the _Clang scoped attribute identifier as an alias for clang. It also introduces a warning with a fixit on the off chance someone attempts to use __clang__ as the scoped attribute (which is a predefined compiler identification macro).

llvm-svn: 346521
2018-11-09 17:19:45 +00:00
Aaron Ballman ad672ffb64 Support accepting __gnu__ as a scoped attribute namespace that aliases to gnu.
This is useful in libstdc++ to avoid clashes with identifiers in the user's namespace.

llvm-svn: 345132
2018-10-24 12:26:23 +00:00
Sven van Haastregt 7b39a085d9 Fix Wundef NDEBUG warning; NFC
Check for definedness of the NDEBUG macro rather than its value,
to be consistent with other uses.

llvm-svn: 342876
2018-09-24 12:12:03 +00:00
Erich Keane 03406c50fa [NFC] Convert ParsedAttr to use llvm::TrailingObjects
ParsedAttr is using a hand-rolled trailing-objects
implementation that gets cleaned up quite a bit by
just using llvm::TrailingObjects. This is a large
TrailingObjects list, but most things are length '0'.

Differential Revision: https://reviews.llvm.org/D50531

llvm-svn: 339380
2018-08-09 20:25:12 +00:00
Erich Keane e891aa971a [NFC] Rename clang::AttributeList to clang::ParsedAttr
Since The type no longer contains the 'next' item anymore, it isn't a list,
so rename it to ParsedAttr to be more accurate.

llvm-svn: 337005
2018-07-13 15:07:47 +00:00