summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/CBackend
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-08-09 18:31:50 +0000
committerBill Wendling <isanbard@gmail.com>2011-08-09 18:31:50 +0000
commit84ec8f65d1ecca71c5fcabe57f2d190409922fe4 (patch)
tree4d11d1ccbf683cce4c192c0a215e93159e016923 /llvm/lib/Target/CBackend
parent53910d6aaefc1a61b332c61c3d112059cfbe9164 (diff)
downloadbcm5719-llvm-84ec8f65d1ecca71c5fcabe57f2d190409922fe4.tar.gz
bcm5719-llvm-84ec8f65d1ecca71c5fcabe57f2d190409922fe4.zip
Print out the variable declaration only if it is a declaration. Otherwise, a
'static' variable will be emitted twice. PR10081 llvm-svn: 137134
Diffstat (limited to 'llvm/lib/Target/CBackend')
-rw-r--r--llvm/lib/Target/CBackend/CBackend.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/CBackend/CBackend.cpp b/llvm/lib/Target/CBackend/CBackend.cpp
index 5b9a0a297fb..e4ecb9e1c56 100644
--- a/llvm/lib/Target/CBackend/CBackend.cpp
+++ b/llvm/lib/Target/CBackend/CBackend.cpp
@@ -1817,7 +1817,7 @@ bool CWriter::doInitialization(Module &M) {
Out << "\n\n/* Global Variable Declarations */\n";
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
I != E; ++I)
- if (!I->isDeclaration()) {
+ if (I->isDeclaration()) {
// Ignore special globals, such as debug info.
if (getGlobalVariableClass(I))
continue;
OpenPOWER on IntegriCloud