aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-03 17:19:10 +0000
committerChris Lattner <sabre@nondot.org>2004-12-03 17:19:10 +0000
commitcc16a8e73b74d35948c7702a82b6cd02feafed49 (patch)
tree106b23abdf582fcaf538cdf706170bd91556b46e /lib
parent8430182d80c0d6c15e8114288636fe5da616999a (diff)
downloadexternal_llvm-cc16a8e73b74d35948c7702a82b6cd02feafed49.zip
external_llvm-cc16a8e73b74d35948c7702a82b6cd02feafed49.tar.gz
external_llvm-cc16a8e73b74d35948c7702a82b6cd02feafed49.tar.bz2
Fix test/Regression/CodeGen/CBackend/2004-12-03-ExternStatics.ll and
PR472 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/CBackend/CBackend.cpp5
-rw-r--r--lib/Target/CBackend/Writer.cpp5
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp
index 45a29b0..d71a568 100644
--- a/lib/Target/CBackend/CBackend.cpp
+++ b/lib/Target/CBackend/CBackend.cpp
@@ -858,7 +858,10 @@ bool CWriter::doInitialization(Module &M) {
Out << "\n\n/* Global Variable Declarations */\n";
for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
if (!I->isExternal()) {
- Out << "extern ";
+ if (I->hasInternalLinkage())
+ Out << "static ";
+ else
+ Out << "extern ";
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
if (I->hasLinkOnceLinkage())
diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp
index 45a29b0..d71a568 100644
--- a/lib/Target/CBackend/Writer.cpp
+++ b/lib/Target/CBackend/Writer.cpp
@@ -858,7 +858,10 @@ bool CWriter::doInitialization(Module &M) {
Out << "\n\n/* Global Variable Declarations */\n";
for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
if (!I->isExternal()) {
- Out << "extern ";
+ if (I->hasInternalLinkage())
+ Out << "static ";
+ else
+ Out << "extern ";
printType(Out, I->getType()->getElementType(), Mang->getValueName(I));
if (I->hasLinkOnceLinkage())