]> granicus.if.org Git - clang/commit
Improve handling of instantiated thread_local variables in Itanium C++ ABI.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 13 Jan 2017 00:43:31 +0000 (00:43 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 13 Jan 2017 00:43:31 +0000 (00:43 +0000)
commit4a7f5b5806b850e6655ef6e586b76307297eed57
tree722b14240712722322985e3d812b50799d1326c0
parent51b99dcf8f3045f19b7036d26bbe033278483c0a
Improve handling of instantiated thread_local variables in Itanium C++ ABI.

 * Do not initialize these variables when initializing the rest of the
   thread_locals in the TU; they have unordered initialization so they can be
   initialized by themselves.

   This fixes a rejects-valid bug: we would make the per-variable initializer
   function internal, but put it in a comdat keyed off the variable, resulting
   in link errors when the comdat is selected from a different TU (as the per
   TU TLS init function tries to call an init function that does not exist).

 * On Darwin, when we decide that we're not going to emit a thread wrapper
   function at all, demote its linkage to External. Fixes a verifier failure
   on explicit instantiation of a thread_local variable on Darwin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291865 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGDeclCXX.cpp
lib/CodeGen/ItaniumCXXABI.cpp
test/CodeGenCXX/cxx11-thread-local.cpp
test/OpenMP/threadprivate_codegen.cpp