summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-04-19 21:05:03 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-04-19 21:05:03 +0000
commit4f856744e58a96a394298cf77cf875fa8f8860ab (patch)
tree0129e95a9abb3527feb539fe1c0efb3b13e7a460 /clang/lib/CodeGen/CGDecl.cpp
parent1c1a00cf51e5293e596e90d5c29a11c85197d996 (diff)
downloadbcm5719-llvm-4f856744e58a96a394298cf77cf875fa8f8860ab.tar.gz
bcm5719-llvm-4f856744e58a96a394298cf77cf875fa8f8860ab.zip
PR3853: Add CodeGen support for __thread.
llvm-svn: 69545
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index c9e47eba77e..681d8f68afe 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -63,10 +63,6 @@ void CodeGenFunction::EmitBlockVarDecl(const VarDecl &D) {
if (D.hasAttr<AsmLabelAttr>())
CGM.ErrorUnsupported(&D, "__asm__");
- // We don't support __thread yet.
- if (D.isThreadSpecified())
- CGM.ErrorUnsupported(&D, "thread local ('__thread') variable", true);
-
switch (D.getStorageClass()) {
case VarDecl::None:
case VarDecl::Auto:
@@ -110,7 +106,8 @@ CodeGenFunction::CreateStaticBlockVarDecl(const VarDecl &D,
const llvm::Type *LTy = CGM.getTypes().ConvertTypeForMem(Ty);
return new llvm::GlobalVariable(LTy, Ty.isConstant(getContext()), Linkage,
llvm::Constant::getNullValue(LTy), Name,
- &CGM.getModule(), 0, Ty.getAddressSpace());
+ &CGM.getModule(), D.isThreadSpecified(),
+ Ty.getAddressSpace());
}
void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) {
@@ -145,7 +142,7 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) {
GV = new llvm::GlobalVariable(Init->getType(), OldGV->isConstant(),
OldGV->getLinkage(), Init, "",
- &CGM.getModule(), 0,
+ &CGM.getModule(), D.isThreadSpecified(),
D.getType().getAddressSpace());
// Steal the name of the old global
OpenPOWER on IntegriCloud