aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2025-01-17 19:42:21 +0000
committerDavid Blaikie <dblaikie@gmail.com>2025-01-23 22:29:30 +0000
commit42043c423ff01d8d07f33aed76819d3b716bba0c (patch)
tree50cd6366edfab0ab11870b05382ae88f465ff620 /llvm/lib/IR/Verifier.cpp
parent9324e6a7a5c5adc5b5c38c3e3cbecd7e1e98876a (diff)
downloadllvm-42043c423ff01d8d07f33aed76819d3b716bba0c.zip
llvm-42043c423ff01d8d07f33aed76819d3b716bba0c.tar.gz
llvm-42043c423ff01d8d07f33aed76819d3b716bba0c.tar.bz2
Reapply "Verifier: Add check for DICompositeType elements being null"
This remove some erroneous debug info from tests that should address the test failures that showed up when the this was previously committed. This reverts commit 6716ce8b641f0e42e2343e1694ee578b027be0c4.
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 7b6f7b5..00280db 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -1319,6 +1319,8 @@ void Verifier::visitDICompositeType(const DICompositeType &N) {
unsigned DIBlockByRefStruct = 1 << 4;
CheckDI((N.getFlags() & DIBlockByRefStruct) == 0,
"DIBlockByRefStruct on DICompositeType is no longer supported", &N);
+ CheckDI(llvm::all_of(N.getElements(), [](const DINode *N) { return N; }),
+ "DISubprogram contains null entry in `elements` field", &N);
if (N.isVector()) {
const DINodeArray Elements = N.getElements();