summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-06-21 02:43:02 +0000
committerRichard Trieu <rtrieu@google.com>2014-06-21 02:43:02 +0000
commit7921239c411aeeaef55998cc64495aa1ea1a3ea3 (patch)
tree5d606ccc0402f191214c7db4b647fa86d2b9ff0b /lib/Transforms
parent5d0ff9c9289fc4f9e99c7b27b7c8b42597cd8765 (diff)
downloadllvm-7921239c411aeeaef55998cc64495aa1ea1a3ea3.tar.gz
llvm-7921239c411aeeaef55998cc64495aa1ea1a3ea3.tar.bz2
llvm-7921239c411aeeaef55998cc64495aa1ea1a3ea3.tar.xz
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
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Instrumentation/DebugIR.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/Instrumentation/DebugIR.cpp b/lib/Transforms/Instrumentation/DebugIR.cpp
index 1bfef574dd..f2f1738808 100644
--- a/lib/Transforms/Instrumentation/DebugIR.cpp
+++ b/lib/Transforms/Instrumentation/DebugIR.cpp
@@ -352,10 +352,12 @@ private:
}
std::string getTypeName(Type *T) {
- assert(T != nullptr && "Expecting non-null Type");
std::string TypeName;
raw_string_ostream TypeStream(TypeName);
- T->print(TypeStream);
+ if (T)
+ T->print(TypeStream);
+ else
+ TypeStream << "Printing <null> Type";
TypeStream.flush();
return TypeName;
}