DebugInfo: Require non-null in DIBuilder::retainType()
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 27 Mar 2015 23:00:49 +0000 (23:00 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 27 Mar 2015 23:00:49 +0000 (23:00 +0000)
Assert that a non-null value is being passed in.  Note that I fixed the
one offender in clang in r233443.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233445 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/DIBuilder.cpp

index ec5ee7da5cb6f5b78db60310b5bf6a6202db1d94..4b837af9d44b3b5cc372bd88e3ea3e9f26cfdf1a 100644 (file)
@@ -509,7 +509,10 @@ DIType DIBuilder::createObjectPointerType(DIType Ty) {
   return createTypeWithFlags(VMContext, Ty, Flags);
 }
 
-void DIBuilder::retainType(DIType T) { AllRetainTypes.emplace_back(T); }
+void DIBuilder::retainType(DIType T) {
+  assert(T.get() && "Expected non-null type");
+  AllRetainTypes.emplace_back(T);
+}
 
 DIBasicType DIBuilder::createUnspecifiedParameter() {
   return DIBasicType();