diff options
author | Chris Lattner <sabre@nondot.org> | 2003-06-06 07:10:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-06-06 07:10:24 +0000 |
commit | 940b08dd1e772d22e57851c50ff53a3a1ebc0730 (patch) | |
tree | ce2ab9ea7dea08e31cd25b74778e3200e731157b /lib/Target/CBackend/CBackend.cpp | |
parent | 4e8c999518361ceafd2f816e29f76284c7f8a210 (diff) |
Don't output explicit initializers for globals that are zero initialized
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6651 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/CBackend/CBackend.cpp')
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 954266163b..39e09fb40f 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.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"; } } |