summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-08-08 01:37:14 +0000
committerEric Christopher <echristo@apple.com>2010-08-08 01:37:14 +0000
commit6ff7161d51a9e5a43fd7e69ab2df69a67fcd12e3 (patch)
tree5b0dbf8bfe877ba9e827ed0600dda15dccf69fcb /clang/lib/CodeGen/CodeGenModule.cpp
parent8aa19b05eed2cb72491fc2b69dc4c8913c3e58f9 (diff)
downloadbcm5719-llvm-6ff7161d51a9e5a43fd7e69ab2df69a67fcd12e3.tar.gz
bcm5719-llvm-6ff7161d51a9e5a43fd7e69ab2df69a67fcd12e3.zip
Thread local variables aren't considered common linkage.
llvm-svn: 110530
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 297aa4524e3..6283b744c3e 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud