Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions llvm/lib/IR/Verifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,11 @@ void Verifier::visitFunction(const Function &F) {
Check(verifyAttributeCount(Attrs, FT->getNumParams()),
"Attribute after last parameter!", &F);

CheckDI(F.IsNewDbgInfoFormat == F.getParent()->IsNewDbgInfoFormat,
"Function debug format should match parent module", &F,
F.IsNewDbgInfoFormat, F.getParent(),
F.getParent()->IsNewDbgInfoFormat);

bool IsIntrinsic = F.isIntrinsic();

// Check function attributes.
Expand Down Expand Up @@ -3017,6 +3022,11 @@ void Verifier::visitBasicBlock(BasicBlock &BB) {
Check(I.getParent() == &BB, "Instruction has bogus parent pointer!");
}

CheckDI(BB.IsNewDbgInfoFormat == BB.getParent()->IsNewDbgInfoFormat,
"BB debug format should match parent function", &BB,
BB.IsNewDbgInfoFormat, BB.getParent(),
BB.getParent()->IsNewDbgInfoFormat);

// Confirm that no issues arise from the debug program.
if (BB.IsNewDbgInfoFormat)
CheckDI(!BB.getTrailingDPValues(), "Basic Block has trailing DbgRecords!",
Expand Down