[llvm-commits] [dragonegg] r97400 - /dragonegg/trunk/llvm-backend.cpp

Duncan Sands baldrick at free.fr
Sun Feb 28 07:17:43 PST 2010


Author: baldrick
Date: Sun Feb 28 09:17:43 2010
New Revision: 97400

URL: http://llvm.org/viewvc/llvm-project?rev=97400&view=rev
Log:
Port commit 97359 (djg) from llvm-gcc:
Opt into the Verifier now that it's an opt-in feature of
addPassesToEmitFile.

Modified:
    dragonegg/trunk/llvm-backend.cpp

Modified: dragonegg/trunk/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-backend.cpp?rev=97400&r1=97399&r2=97400&view=diff
==============================================================================
--- dragonegg/trunk/llvm-backend.cpp (original)
+++ dragonegg/trunk/llvm-backend.cpp Sun Feb 28 09:17:43 2010
@@ -673,12 +673,20 @@
       // -O3 and above.
       OptLevel = CodeGenOpt::Aggressive;
 
+    // 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 file by running the code generator.
     // Note, this also adds codegenerator level optimization passes.
     InitializeOutputStreams(false);
     if (TheTarget->addPassesToEmitFile(*PM, FormattedOutStream,
                                        TargetMachine::CGFT_AssemblyFile,
-                                       OptLevel)) {
+                                       OptLevel, DisableVerify)) {
       errs() << "Error interfacing to target machine!\n";
       exit(1);
     }
@@ -762,12 +770,20 @@
       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 file by running the code generator.
       // Note, this also adds codegenerator level optimization passes.
       InitializeOutputStreams(false);
       if (TheTarget->addPassesToEmitFile(*PM, FormattedOutStream,
                                          TargetMachine::CGFT_AssemblyFile,
-                                         OptLevel)) {
+                                         OptLevel, DisableVerify)) {
         errs() << "Error interfacing to target machine!\n";
         exit(1);
       }





More information about the llvm-commits mailing list