diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index afc4b6d63c6..a6d6cbe83c3 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -253,6 +253,11 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV, Out << "0x" << utohexstr(*(uint64_t*)Ptr); } else if (const ConstantArray *CA = dyn_cast(CV)) { + if (CA->getNumOperands() > 5 && CA->isNullValue()) { + Out << "zeroinitializer"; + return; + } + // As a special case, print the array as a string if it is an array of // ubytes or an array of sbytes with positive values. // @@ -300,6 +305,11 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV, Out << " ]"; } } else if (const ConstantStruct *CS = dyn_cast(CV)) { + if (CS->getNumOperands() > 5 && CS->isNullValue()) { + Out << "zeroinitializer"; + return; + } + Out << "{"; if (CS->getNumOperands()) { Out << " ";