[llvm] r233445 - DebugInfo: Require non-null in DIBuilder::retainType()

Duncan P. N. Exon Smith dexonsmith at apple.com
Fri Mar 27 16:00:49 PDT 2015


Author: dexonsmith
Date: Fri Mar 27 18:00:49 2015
New Revision: 233445

URL: http://llvm.org/viewvc/llvm-project?rev=233445&view=rev
Log:
DebugInfo: Require non-null in DIBuilder::retainType()

Assert that a non-null value is being passed in.  Note that I fixed the
one offender in clang in r233443.

Modified:
    llvm/trunk/lib/IR/DIBuilder.cpp

Modified: llvm/trunk/lib/IR/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DIBuilder.cpp?rev=233445&r1=233444&r2=233445&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DIBuilder.cpp (original)
+++ llvm/trunk/lib/IR/DIBuilder.cpp Fri Mar 27 18:00:49 2015
@@ -509,7 +509,10 @@ DIType DIBuilder::createObjectPointerTyp
   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();





More information about the llvm-commits mailing list