diff options
author | Chris Lattner <sabre@nondot.org> | 2003-06-28 17:08:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-06-28 17:08:36 +0000 |
commit | 76d9f1b467da4316e3c335df9b71bc369832e2f2 (patch) | |
tree | cff25343ff425c4d99922bd3667c67079528e096 | |
parent | a4610ec6babfd341a7aaeb94c7f75343b72bb25d (diff) | |
download | external_llvm-76d9f1b467da4316e3c335df9b71bc369832e2f2.zip external_llvm-76d9f1b467da4316e3c335df9b71bc369832e2f2.tar.gz external_llvm-76d9f1b467da4316e3c335df9b71bc369832e2f2.tar.bz2 |
Fix bug: CBackend/2003-06-28-LinkOnceGlobalVars.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6931 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 2 | ||||
-rw-r--r-- | lib/Target/CBackend/Writer.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index b360140..739e270 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.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()); diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index b360140..739e270 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/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()); |