[llvm-commits] [llvm] r97502 - /llvm/trunk/tools/llc/llc.cpp

Dan Gohman gohman at apple.com
Mon Mar 1 13:45:21 PST 2010


Author: djg
Date: Mon Mar  1 15:45:21 2010
New Revision: 97502

URL: http://llvm.org/viewvc/llvm-project?rev=97502&view=rev
Log:
Make llc opt into the addPassesToEmitFile verify pass.

Modified:
    llvm/trunk/tools/llc/llc.cpp

Modified: llvm/trunk/tools/llc/llc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=97502&r1=97501&r2=97502&view=diff
==============================================================================
--- llvm/trunk/tools/llc/llc.cpp (original)
+++ llvm/trunk/tools/llc/llc.cpp Mon Mar  1 15:45:21 2010
@@ -305,6 +305,14 @@
   case '3': OLvl = 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
+
   // If this target requires addPassesToEmitWholeFile, do it now.  This is
   // used by strange things like the C backend.
   if (Target.WantsWholeFile()) {
@@ -320,7 +328,8 @@
       PM.add(createVerifierPass());
 
     // Ask the target to add backend passes as necessary.
-    if (Target.addPassesToEmitWholeFile(PM, *Out, FileType, OLvl)) {
+    if (Target.addPassesToEmitWholeFile(PM, *Out, FileType, OLvl,
+                                        DisableVerify)) {
       errs() << argv[0] << ": target does not support generation of this"
              << " file type!\n";
       if (Out != &fouts()) delete Out;
@@ -347,7 +356,8 @@
     // Override default to generate verbose assembly.
     Target.setAsmVerbosityDefault(true);
 
-    if (Target.addPassesToEmitFile(Passes, *Out, FileType, OLvl)) {
+    if (Target.addPassesToEmitFile(Passes, *Out, FileType, OLvl,
+                                   DisableVerify)) {
       errs() << argv[0] << ": target does not support generation of this"
              << " file type!\n";
       if (Out != &fouts()) delete Out;





More information about the llvm-commits mailing list