PR472
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18459
91177308-0d34-0410-b5e6-
96231b3b80d8
Out << "\n\n/* Global Variable Declarations */\n";
for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
if (!I->isExternal()) {
- Out << "extern ";
+ if (I->hasInternalLinkage())
+ Out << "static ";
+ else
+ Out << "extern ";
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
if (I->hasLinkOnceLinkage())
Out << "\n\n/* Global Variable Declarations */\n";
for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
if (!I->isExternal()) {
- Out << "extern ";
+ if (I->hasInternalLinkage())
+ Out << "static ";
+ else
+ Out << "extern ";
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
if (I->hasLinkOnceLinkage())