[cfe-commits] r97358 - /cfe/trunk/lib/Frontend/CodeGenAction.cpp

Dan Gohman gohman at apple.com
Sat Feb 27 16:55:40 PST 2010


Author: djg
Date: Sat Feb 27 18:55:40 2010
New Revision: 97358

URL: http://llvm.org/viewvc/llvm-project?rev=97358&view=rev
Log:
Opt into the Verifier now that it's an opt-in feature of
addPassesToEmitFile.

Modified:
    cfe/trunk/lib/Frontend/CodeGenAction.cpp

Modified: cfe/trunk/lib/Frontend/CodeGenAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CodeGenAction.cpp?rev=97358&r1=97357&r2=97358&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CodeGenAction.cpp (original)
+++ cfe/trunk/lib/Frontend/CodeGenAction.cpp Sat Feb 27 18:55:40 2010
@@ -314,12 +314,21 @@
     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;
     }





More information about the cfe-commits mailing list