]> granicus.if.org Git - clang/commitdiff
Opt into the Verifier now that it's an opt-in feature of
authorDan Gohman <gohman@apple.com>
Sun, 28 Feb 2010 00:55:40 +0000 (00:55 +0000)
committerDan Gohman <gohman@apple.com>
Sun, 28 Feb 2010 00:55:40 +0000 (00:55 +0000)
addPassesToEmitFile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97358 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CodeGenAction.cpp

index eb2990405d53988a81a489c5021421025e52e830..b1795a3aa3b54db075426a59974dd89b56cdad66 100644 (file)
@@ -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;
     }