Skip to content

Commit

Permalink
Add some context to fatal verifier errors
Browse files Browse the repository at this point in the history
Summary: Add function name when verification fails as an initial breadcrumb for debugging.

Patch by David Callahan.

Reviewers: mehdi_amini, modocache

Reviewed By: modocache

Subscribers: llvm-commits, modocache

Differential Revision: https://reviews.llvm.org/D51386

llvm-svn: 341974
  • Loading branch information
trentxintong committed Sep 11, 2018
1 parent 8238580 commit 2533f74
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llvm/lib/IR/Verifier.cpp
Expand Up @@ -4730,9 +4730,10 @@ struct VerifierLegacyPass : public FunctionPass {
}

bool runOnFunction(Function &F) override {
if (!V->verify(F) && FatalErrors)
if (!V->verify(F) && FatalErrors) {
errs() << "in function " << F.getName() << '\n';
report_fatal_error("Broken function found, compilation aborted!");

}
return false;
}

Expand Down

0 comments on commit 2533f74

Please sign in to comment.