summaryrefslogtreecommitdiff
path: root/clang/lib/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2015-05-26 19:44:52 +0000
committerAaron Ballman <aaron@aaronballman.com>2015-05-26 19:44:52 +0000
commit674cf26892a724ffff202d3e48ff6b25b3a46a6d (patch)
treecff5c26ee68a79ef6b9e83e35aaa7dc06710733a /clang/lib/Basic/IdentifierTable.cpp
parent74df0df135e17963761e4771755ed091a4f99c96 (diff)
downloadllvm-674cf26892a724ffff202d3e48ff6b25b3a46a6d.tar.gz
__declspec is not a core Clang language extension. Instead, require -fms-extensions or -fborland to enable the language extension.
Note: __declspec is also temporarily enabled when compiling for a CUDA target because there are implementation details relying on __declspec(property) support currently. When those details change, __declspec should be disabled for CUDA targets. llvm-svn: 238238
Diffstat (limited to 'clang/lib/Basic/IdentifierTable.cpp')
-rw-r--r--clang/lib/Basic/IdentifierTable.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp
index 629b236eee43..e830be9603e6 100644
--- a/clang/lib/Basic/IdentifierTable.cpp
+++ b/clang/lib/Basic/IdentifierTable.cpp
@@ -215,6 +215,12 @@ void IdentifierTable::AddKeywords(const LangOptions &LangOpts) {
if (LangOpts.ParseUnknownAnytype)
AddKeyword("__unknown_anytype", tok::kw___unknown_anytype, KEYALL,
LangOpts, *this);
+
+ // FIXME: __declspec isn't really a CUDA extension, however it is required for
+ // supporting cuda_builtin_vars.h, which uses __declspec(property). Once that
+ // has been rewritten in terms of something more generic, remove this code.
+ if (LangOpts.CUDA)
+ AddKeyword("__declspec", tok::kw___declspec, KEYALL, LangOpts, *this);
}
/// \brief Checks if the specified token kind represents a keyword in the