summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/AsmWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/VMCore/AsmWriter.cpp')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index 5406c833a22..b42ccc18471 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -755,9 +755,12 @@ std::ostream &AssemblyWriter::printTypeAtLeastOneLevel(const Type *Ty) {
void AssemblyWriter::writeOperand(const Value *Operand, bool PrintType,
bool PrintName) {
- assert(Operand != 0 && "Illegal Operand");
- if (PrintType) { Out << ' '; printType(Operand->getType()); }
- WriteAsOperandInternal(Out, Operand, PrintName, TypeNames, &Machine);
+ if (Operand != 0) {
+ if (PrintType) { Out << ' '; printType(Operand->getType()); }
+ WriteAsOperandInternal(Out, Operand, PrintName, TypeNames, &Machine);
+ } else {
+ Out << "<null operand!>";
+ }
}
OpenPOWER on IntegriCloud