llvm-project/clang/utils/TableGen
Justin Lebar 4086fe5cd1 [TableGen] Only normalize the spelling of GNU-style attributes.
Summary:
When Sema looks up an attribute name, it strips off leading and trailing
"__" if the attribute is GNU-style.  That is, __attribute__((foo)) and
__attribute__((__foo__)) are equivalent.

This is only true for GNU-style attributes.  In particular,
__declspec(__foo__) is not equivalent to __declspec(foo), and Sema
respects this difference.

This patch fixes TableGen to match Sema's behavior.  The spelling
'GNU<"__foo__">' should be normalized to 'GNU<"foo">', but
'Declspec<"__foo__">' should not be changed.

This is necessary to make CUDA compilation work on Windows, because e.g.
the __device__ attribute is spelled __declspec(__device__).

Attr.td does not contain any Declspec spellings that start or end with
"__", so this change should not affect any other attributes.

Reviewers: rnk

Subscribers: cfe-commits, tra

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

llvm-svn: 291129
2017-01-05 16:51:54 +00:00
..
CMakeLists.txt [CMake] Deprecate CLANG_RUNTIME_OUTPUT_INTDIR and CLANG_LIBRARY_OUTPUT_INTDIR. 2014-01-19 13:00:01 +00:00
ClangASTNodesEmitter.cpp TableGen: Adapt to llvm r288612 2016-12-04 05:55:09 +00:00
ClangAttrEmitter.cpp [TableGen] Only normalize the spelling of GNU-style attributes. 2017-01-05 16:51:54 +00:00
ClangCommentCommandInfoEmitter.cpp Fix Clang-tidy modernize-use-nullptr warnings in headers and generated files; other minor cleanups. 2015-09-29 20:56:43 +00:00
ClangCommentHTMLNamedCharacterReferenceEmitter.cpp
ClangCommentHTMLTagsEmitter.cpp Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:42:19 +00:00
ClangDiagnosticsEmitter.cpp Use noexcept instead of LLVM_NOEXCEPT now that all compilers support it 2016-10-19 23:39:55 +00:00
ClangSACheckersEmitter.cpp [C++11] Use 'nullptr'. 2014-05-07 06:21:57 +00:00
NeonEmitter.cpp Adapt to llvm/TableGen DagInit changes. 2016-12-05 06:00:51 +00:00
TableGen.cpp Turn cl::values() (for enum) from a vararg function to using C++ variadic template 2016-10-08 19:41:06 +00:00
TableGenBackends.h Add a mode to clang-tblgen to generate reference documentation for warning and 2016-09-12 05:58:29 +00:00