summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-02-28 00:55:40 +0000
committerDan Gohman <gohman@apple.com>2010-02-28 00:55:40 +0000
commit357421ea124c451663fe14b0d1fa4c206dfa4d23 (patch)
treee93140eec0eec5b2048cb12deb6271894df8e184
parent0d8a9af7b801afa8022a9df598237063cd55a27e (diff)
downloadbcm5719-llvm-357421ea124c451663fe14b0d1fa4c206dfa4d23.tar.gz
bcm5719-llvm-357421ea124c451663fe14b0d1fa4c206dfa4d23.zip
Opt into the Verifier now that it's an opt-in feature of
addPassesToEmitFile. llvm-svn: 97358
-rw-r--r--clang/lib/Frontend/CodeGenAction.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CodeGenAction.cpp b/clang/lib/Frontend/CodeGenAction.cpp
index eb2990405d5..b1795a3aa3b 100644
--- a/clang/lib/Frontend/CodeGenAction.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud