summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CWriter/Writer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-06-28 17:08:36 +0000
committerChris Lattner <sabre@nondot.org>2003-06-28 17:08:36 +0000
commit90921a7eeef0cea9488e38cd2adaf17fcb919606 (patch)
tree3e56eb112d187b6eaf62f8a89269593781727661 /llvm/lib/CWriter/Writer.cpp
parentde025f3220896129ddce3ce840427bccd1160644 (diff)
downloadbcm5719-llvm-90921a7eeef0cea9488e38cd2adaf17fcb919606.tar.gz
bcm5719-llvm-90921a7eeef0cea9488e38cd2adaf17fcb919606.zip
Fix bug: CBackend/2003-06-28-LinkOnceGlobalVars.llx
llvm-svn: 6931
Diffstat (limited to 'llvm/lib/CWriter/Writer.cpp')
-rw-r--r--llvm/lib/CWriter/Writer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp
index b360140d7bf..739e270f29a 100644
--- a/llvm/lib/CWriter/Writer.cpp
+++ b/llvm/lib/CWriter/Writer.cpp
@@ -682,6 +682,8 @@ void CWriter::printModule(Module *M) {
if (I->hasInternalLinkage())
Out << "static ";
printType(Out, I->getType()->getElementType(), getValueName(I));
+ if (I->hasLinkOnceLinkage())
+ Out << " __attribute__((common))";
if (!I->getInitializer()->isNullValue()) {
Out << " = " ;
writeOperand(I->getInitializer());
OpenPOWER on IntegriCloud