[llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp

Vikram Adve vadve at cs.uiuc.edu
Sat Oct 5 18:44:01 PDT 2002


Changes in directory llvm/lib/CWriter:

Writer.cpp updated: 1.60 -> 1.61

---
Log message:

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).


---
Diffs of the changes:

Index: llvm/lib/CWriter/Writer.cpp
diff -u llvm/lib/CWriter/Writer.cpp:1.60 llvm/lib/CWriter/Writer.cpp:1.61
--- llvm/lib/CWriter/Writer.cpp:1.60	Thu Oct  3 15:47:24 2002
+++ llvm/lib/CWriter/Writer.cpp	Sat Oct  5 18:43:10 2002
@@ -563,9 +563,8 @@
   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()) {





More information about the llvm-commits mailing list