summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-30 08:40:34 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-30 08:40:34 +0000
commit2c11cd156ef1bf5aee2ac30f8b3ad190bdd9572c (patch)
tree665757a84aeca8b7a78290c1f884f4fc5b4711cf /clang/lib/CodeGen/CodeGenModule.cpp
parent8e7050569275493e9a1aed54dacb039320abe853 (diff)
downloadbcm5719-llvm-2c11cd156ef1bf5aee2ac30f8b3ad190bdd9572c.tar.gz
bcm5719-llvm-2c11cd156ef1bf5aee2ac30f8b3ad190bdd9572c.zip
Don't try to generate common globals for C++ files, instead of depending on the FE to set NoCommon, and simplify CodeGenOptions initialization.
llvm-svn: 90119
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index bbad876575d..a14733aba02 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -973,7 +973,7 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage);
} else if (Linkage == GVA_TemplateInstantiation)
GV->setLinkage(llvm::GlobalVariable::WeakAnyLinkage);
- else if (!CodeGenOpts.NoCommon &&
+ else if (!getLangOptions().CPlusPlus && !CodeGenOpts.NoCommon &&
!D->hasExternalStorage() && !D->getInit() &&
!D->getAttr<SectionAttr>()) {
GV->setLinkage(llvm::GlobalVariable::CommonLinkage);
OpenPOWER on IntegriCloud