diff options
author | Dan Gohman <gohman@apple.com> | 2010-02-28 00:55:40 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-02-28 00:55:40 +0000 |
commit | d68fc055e17e8b01ac824d8ab749bc169fc4b93d (patch) | |
tree | a8b4b2b50c6ff331f92ffe2cdd59e77c938b2ac7 /lib/Frontend | |
parent | 5d7af6b0da99f0bede6facb4bb9e5a5872afdb61 (diff) |
Opt into the Verifier now that it's an opt-in feature of
addPassesToEmitFile.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97358 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend')
-rw-r--r-- | lib/Frontend/CodeGenAction.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Frontend/CodeGenAction.cpp b/lib/Frontend/CodeGenAction.cpp index eb2990405d..b1795a3aa3 100644 --- a/lib/Frontend/CodeGenAction.cpp +++ b/lib/Frontend/CodeGenAction.cpp @@ -314,12 +314,21 @@ bool BackendConsumer::AddEmitPasses() { case 3: OptLevel = CodeGenOpt::Aggressive; break; } + // Request that addPassesToEmitFile run the Verifier after running + // passes which modify the IR. +#ifndef NDEBUG + bool DisableVerify = false; +#else + bool DisableVerify = true; +#endif + // Normal mode, emit a .s or .o file by running the code generator. Note, // this also adds codegenerator level optimization passes. TargetMachine::CodeGenFileType CGFT = TargetMachine::CGFT_AssemblyFile; if (Action == Backend_EmitObj) CGFT = TargetMachine::CGFT_ObjectFile; - if (TM->addPassesToEmitFile(*PM, FormattedOutStream, CGFT, OptLevel)) { + if (TM->addPassesToEmitFile(*PM, FormattedOutStream, CGFT, OptLevel, + DisableVerify)) { Diags.Report(diag::err_fe_unable_to_interface_with_target); return false; } |