Skip to content

Commit

Permalink
Merge rust-lang#33
Browse files Browse the repository at this point in the history
33: In debug builds, verify the IR after the control point pass. r=ltratt a=vext01



Co-authored-by: Edd Barrett <vext01@gmail.com>
  • Loading branch information
bors[bot] and vext01 committed Apr 8, 2022
2 parents 043c401 + 1b29b69 commit 2a19561
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion llvm/lib/Transforms/Yk/ControlPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,14 @@ class YkControlPoint : public ModulePass {
Builder.SetInsertPoint(BB);
Builder.CreateCondBr(NewCtrlPointCallInst, ExitBB, ContBB);

// Generate new control point logic.
#ifndef NDEBUG
// Our pass runs after LLVM normally does its verify pass. In debug builds
// we run it again to check that our pass is generating valid IR.
if (verifyModule(M, &errs())) {
Context.emitError("Control point pass generated invalid IR!");
return false;
}
#endif
return true;
}
};
Expand Down

0 comments on commit 2a19561

Please sign in to comment.