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 | 56ebe5082da7411fb37479e230b52735f77cff35 (patch) | |
tree | 69ef5402d63f726377560cf2562345f31ad03630 /lib/CodeGen/CGDecl.cpp | |
parent | 332ee08e2fe78fde281e0868ec039b546cb6e0f4 (diff) |
PR3853: Add CodeGen support for __thread.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69545 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index c9e47eba77..681d8f68af 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/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 |