[Mlir-commits] [lld] [llvm] [mlir] [DebugInfo] Verify DISubprogram has a type (PR #194556)

Jiang Ning llvmlistbot at llvm.org
Tue Apr 28 20:13:54 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)
----------------
JiangNingHX wrote:

Thanks, fixed. I removed the redundant null check after `CheckDI(T, ...)`.

https://github.com/llvm/llvm-project/pull/194556


More information about the Mlir-commits mailing list