summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CWriter/Writer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-06-06 07:10:24 +0000
committerChris Lattner <sabre@nondot.org>2003-06-06 07:10:24 +0000
commitb630abfd474b3843ebc4e40d9f27aa1b4b4d537b (patch)
tree7bc6159f81b7573c02c1a5ae55f581b3d2b728df /llvm/lib/CWriter/Writer.cpp
parent0ccdecbdaaebbd424f8b8afad67309d8b69d4c93 (diff)
downloadbcm5719-llvm-b630abfd474b3843ebc4e40d9f27aa1b4b4d537b.tar.gz
bcm5719-llvm-b630abfd474b3843ebc4e40d9f27aa1b4b4d537b.zip
Don't output explicit initializers for globals that are zero initialized
llvm-svn: 6651
Diffstat (limited to 'llvm/lib/CWriter/Writer.cpp')
-rw-r--r--llvm/lib/CWriter/Writer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CWriter/Writer.cpp b/llvm/lib/CWriter/Writer.cpp
index 954266163b1..39e09fb40f3 100644
--- a/llvm/lib/CWriter/Writer.cpp
+++ b/llvm/lib/CWriter/Writer.cpp
@@ -73,7 +73,6 @@ namespace {
void printModule(Module *M);
void printSymbolTable(const SymbolTable &ST);
void printContainedStructs(const Type *Ty, std::set<const StructType *> &);
- void printGlobal(const GlobalVariable *GV);
void printFunctionSignature(const Function *F, bool Prototype);
void printFunction(Function *);
@@ -619,9 +618,10 @@ void CWriter::printModule(Module *M) {
if (I->hasInternalLinkage())
Out << "static ";
printType(Out, I->getType()->getElementType(), getValueName(I));
-
- Out << " = " ;
- writeOperand(I->getInitializer());
+ if (!I->getInitializer()->isNullValue()) {
+ Out << " = " ;
+ writeOperand(I->getInitializer());
+ }
Out << ";\n";
}
}
OpenPOWER on IntegriCloud