Skip to content

Commit

Permalink
[opt] Only create Verifier passes when requested
Browse files Browse the repository at this point in the history
opt adds Verifier passes in AddOptimizationPasses even if
-disable-verify is on. Fix it so that the extra verification occurs
either when (1) -disable-verifier is off, or (2) -verify-each is on.

Thanks to David Jones for pointing out this behavior!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263090 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
vedantk committed Mar 10, 2016
1 parent 225dd82 commit d449fa8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/opt/opt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ static inline void addPass(legacy::PassManagerBase &PM, Pass *P) {
static void AddOptimizationPasses(legacy::PassManagerBase &MPM,
legacy::FunctionPassManager &FPM,
unsigned OptLevel, unsigned SizeLevel) {
FPM.add(createVerifierPass()); // Verify that input is correct
if (!NoVerify || VerifyEach)
FPM.add(createVerifierPass()); // Verify that input is correct

PassManagerBuilder Builder;
Builder.OptLevel = OptLevel;
Expand Down

0 comments on commit d449fa8

Please sign in to comment.