Skip to content

Commit 5043f91

Browse files
committed
DebugInfo: Don't call DIBuilder::retainType(nullptr)
An upcoming LLVM commit will make calling `DIBuilder::retainType(nullptr)` illegal (actually, it already was, but it wasn't verified). Check for null before calling. This triggered in test/CodeGenObjC/debug-info-block-helper.m. llvm-svn: 233443
1 parent d5c60d0 commit 5043f91

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3432,7 +3432,8 @@ void CGDebugInfo::finalize() {
34323432
void CGDebugInfo::EmitExplicitCastType(QualType Ty) {
34333433
if (CGM.getCodeGenOpts().getDebugInfo() < CodeGenOptions::LimitedDebugInfo)
34343434
return;
3435-
llvm::DIType DieTy = getOrCreateType(Ty, getOrCreateMainFile());
3436-
// Don't ignore in case of explicit cast where it is referenced indirectly.
3437-
DBuilder.retainType(DieTy);
3435+
3436+
if (llvm::DIType DieTy = getOrCreateType(Ty, getOrCreateMainFile()))
3437+
// Don't ignore in case of explicit cast where it is referenced indirectly.
3438+
DBuilder.retainType(DieTy);
34383439
}

0 commit comments

Comments
 (0)