Skip to content

Commit d9ccfb9

Browse files
committed
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. llvm-svn: 233445
1 parent 49147e3 commit d9ccfb9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/IR/DIBuilder.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,10 @@ DIType DIBuilder::createObjectPointerType(DIType Ty) {
509509
return createTypeWithFlags(VMContext, Ty, Flags);
510510
}
511511

512-
void DIBuilder::retainType(DIType T) { AllRetainTypes.emplace_back(T); }
512+
void DIBuilder::retainType(DIType T) {
513+
assert(T.get() && "Expected non-null type");
514+
AllRetainTypes.emplace_back(T);
515+
}
513516

514517
DIBasicType DIBuilder::createUnspecifiedParameter() {
515518
return DIBasicType();

0 commit comments

Comments
 (0)