diff options
| author | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-10-05 23:43:10 +0000 |
|---|---|---|
| committer | Vikram S. Adve <vadve@cs.uiuc.edu> | 2002-10-05 23:43:10 +0000 |
| commit | 2cc6609e252dae2f7502cdb3b212da74342bfa79 (patch) | |
| tree | 43ad5fef9008c96eb3a404ba5c0cd64e299c690c /llvm/lib/CWriter/Writer.cpp | |
| parent | b8aef8eff8f051cba32e0c706217ca5352587c97 (diff) | |
| download | bcm5719-llvm-2cc6609e252dae2f7502cdb3b212da74342bfa79.tar.gz bcm5719-llvm-2cc6609e252dae2f7502cdb3b212da74342bfa79.zip | |
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
Diffstat (limited to 'llvm/lib/CWriter/Writer.cpp')
| -rw-r--r-- | llvm/lib/CWriter/Writer.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp index bc2106d78fe..51a3d168c17 100644 --- a/llvm/lib/CWriter/Writer.cpp +++ b/llvm/lib/CWriter/Writer.cpp @@ -563,9 +563,8 @@ void CWriter::printModule(Module *M) { 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->hasExternalLinkage()) - continue; // printed above! - Out << "static "; + if (I->hasInternalLinkage()) + Out << "static "; printType(I->getType()->getElementType(), getValueName(I)); if (I->hasInitializer()) { |

