aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2008-12-03 05:51:23 +0000
committerAnders Carlsson <andersca@mac.com>2008-12-03 05:51:23 +0000
commit98883e1e699457697fb8d5ac6d175dd3ee078774 (patch)
tree24747289a06ec63976544d70fd315345500250cb /lib/CodeGen/CodeGenModule.cpp
parent6183e4815a4019e97ad01bd880f12355599b75fd (diff)
If a global var decl has an initializer, make sure to always set its linkage to external.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60462 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index f0aa8b7d14..80ef53f5f9 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -607,6 +607,8 @@ void CodeGenModule::EmitGlobalVarDefinition(const VarDecl *D) {
case VarDecl::None:
if (!D->getInit())
GV->setLinkage(llvm::GlobalVariable::CommonLinkage);
+ else
+ GV->setLinkage(llvm::GlobalVariable::ExternalLinkage);
break;
case VarDecl::Extern:
case VarDecl::PrivateExtern: