@@ -512,19 +512,15 @@ void AnnotateIgnoreWritesEnd(const char *file, int line);
512
512
// / extern globals, and static globals.
513
513
// /
514
514
// / This is essentially an extremely restricted analog to C++11's thread_local
515
- // / support, and uses that when available. However, it falls back on
516
- // / platform-specific or vendor-provided extensions when necessary. These
517
- // / extensions don't support many of the C++11 thread_local's features. You
518
- // / should only use this for PODs that you can statically initialize to
519
- // / some constant value. In almost all circumstances this is most appropriate
520
- // / for use with a pointer, integer, or small aggregation of pointers and
521
- // / integers.
515
+ // / support. It uses thread_local if available, falling back on gcc __thread
516
+ // / if not. __thread doesn't support many of the C++11 thread_local's
517
+ // / features. You should only use this for PODs that you can statically
518
+ // / initialize to some constant value. In almost all circumstances this is most
519
+ // / appropriate for use with a pointer, integer, or small aggregation of
520
+ // / pointers and integers.
522
521
#if LLVM_ENABLE_THREADS
523
- #if __has_feature(cxx_thread_local)
522
+ #if __has_feature(cxx_thread_local) || defined(_MSC_VER)
524
523
#define LLVM_THREAD_LOCAL thread_local
525
- #elif defined(_MSC_VER)
526
- // MSVC supports this with a __declspec.
527
- #define LLVM_THREAD_LOCAL __declspec (thread)
528
524
#else
529
525
// Clang, GCC, and other compatible compilers used __thread prior to C++11 and
530
526
// we only need the restricted functionality that provides.
0 commit comments