diff options
Diffstat (limited to 'lib/IR')
-rw-r--r-- | lib/IR/AsmWriter.cpp | 8 | ||||
-rw-r--r-- | lib/IR/Core.cpp | 2 |
2 files changed, 2 insertions, 8 deletions
diff --git a/lib/IR/AsmWriter.cpp b/lib/IR/AsmWriter.cpp index fc73a61f9f..7afefdc7ac 100644 --- a/lib/IR/AsmWriter.cpp +++ b/lib/IR/AsmWriter.cpp @@ -2156,10 +2156,6 @@ void NamedMDNode::print(raw_ostream &ROS) const { } void Type::print(raw_ostream &OS) const { - if (!this) { - OS << "<null Type>"; - return; - } TypePrinting TP; TP.print(const_cast<Type*>(this), OS); @@ -2172,10 +2168,6 @@ void Type::print(raw_ostream &OS) const { } void Value::print(raw_ostream &ROS) const { - if (!this) { - ROS << "printing a <null> value\n"; - return; - } formatted_raw_ostream OS(ROS); if (const Instruction *I = dyn_cast<Instruction>(this)) { const Function *F = I->getParent() ? I->getParent()->getParent() : nullptr; diff --git a/lib/IR/Core.cpp b/lib/IR/Core.cpp index aa373f602a..f24704c61c 100644 --- a/lib/IR/Core.cpp +++ b/lib/IR/Core.cpp @@ -281,6 +281,7 @@ char *LLVMPrintTypeToString(LLVMTypeRef Ty) { std::string buf; raw_string_ostream os(buf); + assert(unwrap(Ty) != nullptr && "Expecting non-null Type"); unwrap(Ty)->print(os); os.flush(); @@ -531,6 +532,7 @@ char* LLVMPrintValueToString(LLVMValueRef Val) { std::string buf; raw_string_ostream os(buf); + assert(unwrap(Val) != nullptr && "Expecting non-null Value"); unwrap(Val)->print(os); os.flush(); |