Fix bug: CBackend/2003-06-28-LinkOnceGlobalVars.llx
authorChris Lattner <sabre@nondot.org>
Sat, 28 Jun 2003 17:08:36 +0000 (17:08 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 28 Jun 2003 17:08:36 +0000 (17:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6931 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp

index b360140d7bfc05b086a1228d94f72b80b4e8b89c..739e270f29a49b45e5a448601993cca1cbfb313d 100644 (file)
@@ -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());
index b360140d7bfc05b086a1228d94f72b80b4e8b89c..739e270f29a49b45e5a448601993cca1cbfb313d 100644 (file)
@@ -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());