summaryrefslogtreecommitdiff
path: root/tools/opt
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-03-10 03:40:14 +0000
committerVedant Kumar <vsk@apple.com>2016-03-10 03:40:14 +0000
commitd449fa84ed8333592649415ad56eb4a704033cda (patch)
treee9f79f3214614d3639289a92ce981e119f9285f2 /tools/opt
parent225dd82d634ca277a39f59c0541e4c1155c73aa5 (diff)
[opt] Only create Verifier passes when requested
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
Diffstat (limited to 'tools/opt')
-rw-r--r--tools/opt/opt.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 28c1c2bc6c5..11151b8fcda 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -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;