[PATCH] Add support for __declspec(thread) under -fms-extensions
Reid Kleckner
rnk at google.com
Tue Apr 29 15:05:18 PDT 2014
================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2084-2086
@@ -2083,2 +2083,5 @@
"'selectany' can only be applied to data items with external linkage">;
+def err_multiple_thread_specifiers : Error<
+ "__declspec(thread) applied to variable declaration which already has a "
+ "thread specifier">;
def err_attribute_dll_not_extern : Error<
----------------
Richard Smith wrote:
> Please give this a name involving 'declspec'. It's not as general as its name implies.
Done.
================
Comment at: lib/Sema/DeclSpec.cpp:386
@@ -385,2 +385,3 @@
case DeclSpec::TSCS___thread: return "__thread";
+ case DeclSpec::TSCS___declspec_thread: return "__declspec(thread)";
case DeclSpec::TSCS_thread_local: return "thread_local";
----------------
Richard Smith wrote:
> This seems like it should be unreachable.
It's used for diagnostics now, and it uses DeclSpec::TSCS___declspec_thread.
Would you be in favor of a patch that removes the TSCS_* static const ints in DeclSpec and replaces them with uses of the Basic/Specifiers.h enumerators?
http://reviews.llvm.org/D3551
More information about the cfe-commits
mailing list