diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-04-19 21:05:03 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-04-19 21:05:03 +0000 |
commit | 4f856744e58a96a394298cf77cf875fa8f8860ab (patch) | |
tree | 0129e95a9abb3527feb539fe1c0efb3b13e7a460 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 1c1a00cf51e5293e596e90d5c29a11c85197d996 (diff) | |
download | bcm5719-llvm-4f856744e58a96a394298cf77cf875fa8f8860ab.tar.gz bcm5719-llvm-4f856744e58a96a394298cf77cf875fa8f8860ab.zip |
PR3853: Add CodeGen support for __thread.
llvm-svn: 69545
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index a517d81545e..1a52ba2ab19 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -656,10 +656,6 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMGlobal(const char *MangledName, return llvm::ConstantExpr::getBitCast(Entry, Ty); } - // We don't support __thread yet. - if (D && D->isThreadSpecified()) - ErrorUnsupported(D, "thread local ('__thread') variable", true); - // This is the first use or definition of a mangled name. If there is a // deferred decl with this name, remember that we need to emit it at the end // of the file. @@ -676,7 +672,7 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMGlobal(const char *MangledName, new llvm::GlobalVariable(Ty->getElementType(), false, llvm::GlobalValue::ExternalLinkage, 0, "", &getModule(), - 0, Ty->getAddressSpace()); + false, Ty->getAddressSpace()); GV->setName(MangledName); // Handle things which are present even on external declarations. @@ -691,6 +687,8 @@ llvm::Constant *CodeGenModule::GetOrCreateLLVMGlobal(const char *MangledName, if (D->hasAttr<WeakAttr>() || D->hasAttr<WeakImportAttr>()) GV->setLinkage(llvm::GlobalValue::ExternalWeakLinkage); + + GV->setThreadLocal(D->isThreadSpecified()); } return Entry = GV; |