[llvm] [DebugInfo] Verify DISubprogram has a type (PR #194556)
Michael Buch via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 28 02:12:03 PDT 2026
================
@@ -1640,7 +1640,9 @@ void Verifier::visitDISubprogram(const DISubprogram &N) {
CheckDI(isa<DIFile>(F), "invalid file", &N, F);
else
CheckDI(N.getLine() == 0, "line specified with no file", &N, N.getLine());
- if (auto *T = N.getRawType())
+ auto *T = N.getRawType();
+ CheckDI(T, "DISubprogram requires a non-null type", &N);
+ if (T)
----------------
Michael137 wrote:
```suggestion
```
Don't need this null-check since `CheckDI` will return out of the function on failure
https://github.com/llvm/llvm-project/pull/194556
More information about the llvm-commits
mailing list