mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-23 22:23:00 +00:00
Add back functionality removed in r210497.
Instead of asserting, output a message stating that a null pointer was found. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211430 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
+10
-4
@@ -281,8 +281,11 @@ char *LLVMPrintTypeToString(LLVMTypeRef Ty) {
|
||||
std::string buf;
|
||||
raw_string_ostream os(buf);
|
||||
|
||||
assert(unwrap(Ty) != nullptr && "Expecting non-null Type");
|
||||
unwrap(Ty)->print(os);
|
||||
if (unwrap(Ty))
|
||||
unwrap(Ty)->print(os);
|
||||
else
|
||||
os << "Printing <null> Type";
|
||||
|
||||
os.flush();
|
||||
|
||||
return strdup(buf.c_str());
|
||||
@@ -532,8 +535,11 @@ char* LLVMPrintValueToString(LLVMValueRef Val) {
|
||||
std::string buf;
|
||||
raw_string_ostream os(buf);
|
||||
|
||||
assert(unwrap(Val) != nullptr && "Expecting non-null Value");
|
||||
unwrap(Val)->print(os);
|
||||
if (unwrap(Val))
|
||||
unwrap(Val)->print(os);
|
||||
else
|
||||
os << "Printing <null> Value";
|
||||
|
||||
os.flush();
|
||||
|
||||
return strdup(buf.c_str());
|
||||
|
||||
Reference in New Issue
Block a user