diff options
author | Eric Christopher <echristo@apple.com> | 2010-08-08 01:37:14 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2010-08-08 01:37:14 +0000 |
commit | 91f31dc234bbc98f3dd20e6741a7b0b98c7916bf (patch) | |
tree | 5d15a9c1c4a7b97c07bc1f8f5bed10798591aa64 /lib/CodeGen/CodeGenModule.cpp | |
parent | 0d30a87e124bb0273fedce3b62401039073fdece (diff) |
Thread local variables aren't considered common linkage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110530 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 297aa4524e..6283b744c3 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1201,7 +1201,8 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) { GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage); else if (!getLangOptions().CPlusPlus && !CodeGenOpts.NoCommon && !D->hasExternalStorage() && !D->getInit() && - !D->getAttr<SectionAttr>()) { + !D->getAttr<SectionAttr>() && !D->isThreadSpecified()) { + // Thread local vars aren't considered common linkage. GV->setLinkage(llvm::GlobalVariable::CommonLinkage); // common vars aren't constant even if declared const. GV->setConstant(false); |