Fix bug: CBackend/2002-10-16-External.ll

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4201 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2002-10-16 20:08:47 +00:00
parent 8de3fc6f2d
commit e8e035b591
2 changed files with 12 additions and 14 deletions

View File

@ -572,17 +572,16 @@ void CWriter::printModule(Module *M) {
// Output the global variable definitions and contents...
if (!M->gempty()) {
Out << "\n\n/* Global Variable Definitions and Initialization */\n";
for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) {
if (I->hasInternalLinkage())
Out << "static ";
printType(I->getType()->getElementType(), getValueName(I));
for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I)
if (!I->isExternal()) {
if (I->hasInternalLinkage())
Out << "static ";
printType(I->getType()->getElementType(), getValueName(I));
if (I->hasInitializer()) {
Out << " = " ;
writeOperand(I->getInitializer());
Out << ";\n";
}
Out << ";\n";
}
}
// Output all of the functions...

View File

@ -572,17 +572,16 @@ void CWriter::printModule(Module *M) {
// Output the global variable definitions and contents...
if (!M->gempty()) {
Out << "\n\n/* Global Variable Definitions and Initialization */\n";
for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) {
if (I->hasInternalLinkage())
Out << "static ";
printType(I->getType()->getElementType(), getValueName(I));
for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I)
if (!I->isExternal()) {
if (I->hasInternalLinkage())
Out << "static ";
printType(I->getType()->getElementType(), getValueName(I));
if (I->hasInitializer()) {
Out << " = " ;
writeOperand(I->getInitializer());
Out << ";\n";
}
Out << ";\n";
}
}
// Output all of the functions...