Skip to content

Commit 2953d9c

Browse files
committed
Reapply "[RemoveDIs] Add additional debug-mode verifier checks" (#84757)
Test failures fixed in d0117b7
1 parent 538aeb1 commit 2953d9c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

llvm/lib/IR/Verifier.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,6 +2691,11 @@ void Verifier::visitFunction(const Function &F) {
26912691
Check(verifyAttributeCount(Attrs, FT->getNumParams()),
26922692
"Attribute after last parameter!", &F);
26932693

2694+
CheckDI(F.IsNewDbgInfoFormat == F.getParent()->IsNewDbgInfoFormat,
2695+
"Function debug format should match parent module", &F,
2696+
F.IsNewDbgInfoFormat, F.getParent(),
2697+
F.getParent()->IsNewDbgInfoFormat);
2698+
26942699
bool IsIntrinsic = F.isIntrinsic();
26952700

26962701
// Check function attributes.
@@ -3034,6 +3039,11 @@ void Verifier::visitBasicBlock(BasicBlock &BB) {
30343039
Check(I.getParent() == &BB, "Instruction has bogus parent pointer!");
30353040
}
30363041

3042+
CheckDI(BB.IsNewDbgInfoFormat == BB.getParent()->IsNewDbgInfoFormat,
3043+
"BB debug format should match parent function", &BB,
3044+
BB.IsNewDbgInfoFormat, BB.getParent(),
3045+
BB.getParent()->IsNewDbgInfoFormat);
3046+
30373047
// Confirm that no issues arise from the debug program.
30383048
if (BB.IsNewDbgInfoFormat)
30393049
CheckDI(!BB.getTrailingDPValues(), "Basic Block has trailing DbgRecords!",

0 commit comments

Comments
 (0)