Bug fix: In preventing static global variables from being printed twice,
I also prevented external globals from being printed twice, but they should (extern declaration and definition). llvm-svn: 4043
This commit is contained in:
parent
b8aef8eff8
commit
2cc6609e25
|
@ -563,8 +563,7 @@ void CWriter::printModule(Module *M) {
|
||||||
if (!M->gempty()) {
|
if (!M->gempty()) {
|
||||||
Out << "\n\n/* Global Variable Definitions and Initialization */\n";
|
Out << "\n\n/* Global Variable Definitions and Initialization */\n";
|
||||||
for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) {
|
for (Module::giterator I = M->gbegin(), E = M->gend(); I != E; ++I) {
|
||||||
if (I->hasExternalLinkage())
|
if (I->hasInternalLinkage())
|
||||||
continue; // printed above!
|
|
||||||
Out << "static ";
|
Out << "static ";
|
||||||
printType(I->getType()->getElementType(), getValueName(I));
|
printType(I->getType()->getElementType(), getValueName(I));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue