diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-19 16:42:07 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-04-19 16:42:07 +0000 |
commit | 2fd1d7aee3cc168e0d9b78ca53fb2c1fc6684705 (patch) | |
tree | 62e445b7ece6c358846e067997a9d3ac2cb084c0 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 6ac9d13e610dc9005660594ee4325483d2c97fb4 (diff) | |
download | bcm5719-llvm-2fd1d7aee3cc168e0d9b78ca53fb2c1fc6684705.tar.gz bcm5719-llvm-2fd1d7aee3cc168e0d9b78ca53fb2c1fc6684705.zip |
Implement CodeGen for C++11 thread_local, following the Itanium ABI specification as discussed on cxx-abi-dev.
llvm-svn: 179858
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 42be779afb1..fdd35684722 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -176,6 +176,7 @@ void CodeGenModule::Release() { EmitDeferred(); EmitCXXGlobalInitFunc(); EmitCXXGlobalDtorFunc(); + EmitCXXThreadLocalInitFunc(); if (ObjCRuntime) if (llvm::Function *ObjCInitFunction = ObjCRuntime->ModuleInitFunction()) AddGlobalCtor(ObjCInitFunction); @@ -1477,8 +1478,10 @@ CodeGenModule::GetOrCreateLLVMGlobal(StringRef MangledName, GV->setVisibility(GetLLVMVisibility(LV.getVisibility())); } - if (D->getTLSKind()) + if (D->getTLSKind()) { + CXXThreadLocals.push_back(std::make_pair(D, GV)); setTLSMode(GV, *D); + } } if (AddrSpace != Ty->getAddressSpace()) |