Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RemoveDIs] Add additional debug-mode verifier checks #84308

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Changes from 2 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);

Check(F.IsNewDbgInfoFormat == F.getParent()->IsNewDbgInfoFormat,
"Fn debug format should match parent", &F,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be instead of "Fn ..." use "F ..." or "Function ...".

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!");
}

Check(BB.IsNewDbgInfoFormat == BB.getParent()->IsNewDbgInfoFormat,
"BB debug format should match parent", &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
Loading