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
diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp
index bc2106d..51a3d16 100644
--- a/llvm/lib/CWriter/Writer.cpp
+++ b/llvm/lib/CWriter/Writer.cpp
@@ -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()) {