aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/VMCore/AsmWriter.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp
index afc4b6d63c..a6d6cbe83c 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<ConstantArray>(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<ConstantStruct>(CV)) {
+ if (CS->getNumOperands() > 5 && CS->isNullValue()) {
+ Out << "zeroinitializer";
+ return;
+ }
+
Out << "{";
if (CS->getNumOperands()) {
Out << " ";