[llvm-commits] CVS: llvm/tools/bugpoint/BugDriver.h Miscompilation.cpp

Chris Lattner lattner at cs.uiuc.edu
Fri Oct 17 18:04:00 PDT 2003


Changes in directory llvm/tools/bugpoint:

BugDriver.h updated: 1.16 -> 1.17
Miscompilation.cpp updated: 1.16 -> 1.17

---
Log message:

Be more helpful if a pass fails while chasing down a miscompilation


---
Diffs of the changes:  (+9 -2)

Index: llvm/tools/bugpoint/BugDriver.h
diff -u llvm/tools/bugpoint/BugDriver.h:1.16 llvm/tools/bugpoint/BugDriver.h:1.17
--- llvm/tools/bugpoint/BugDriver.h:1.16	Tue Oct 14 16:59:36 2003
+++ llvm/tools/bugpoint/BugDriver.h	Fri Oct 17 18:03:16 2003
@@ -57,6 +57,9 @@
   bool addSources(const std::vector<std::string> &FileNames);
   template<class It>
   void addPasses(It I, It E) { PassesToRun.insert(PassesToRun.end(), I, E); }
+  void setPassesToRun(const std::vector<const PassInfo*> &PTR) {
+    PassesToRun = PTR;
+  }
 
   /// run - The top level method that is invoked after all of the instance
   /// variables are set up from command line arguments.


Index: llvm/tools/bugpoint/Miscompilation.cpp
diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.16 llvm/tools/bugpoint/Miscompilation.cpp:1.17
--- llvm/tools/bugpoint/Miscompilation.cpp:1.16	Tue Oct 14 15:52:55 2003
+++ llvm/tools/bugpoint/Miscompilation.cpp	Fri Oct 17 18:03:16 2003
@@ -57,8 +57,10 @@
   // prefix passes, then discard the prefix passes.
   //
   if (BD.runPasses(Prefix, BytecodeResult, false/*delete*/, true/*quiet*/)) {
-    std::cerr << BD.getToolName() << ": Error running this sequence of passes"
+    std::cerr << ": Error running this sequence of passes" 
               << " on the input program!\n";
+    BD.setPassesToRun(Prefix);
+    BD.EmitProgressBytecode("pass-error",  false);
     exit(1);
   }
 
@@ -88,8 +90,10 @@
   Module *OriginalInput = BD.Program;
   BD.Program = PrefixOutput;
   if (BD.runPasses(Suffix, BytecodeResult, false/*delete*/, true/*quiet*/)) {
-    std::cerr << BD.getToolName() << ": Error running this sequence of passes"
+    std::cerr << ": Error running this sequence of passes" 
               << " on the input program!\n";
+    BD.setPassesToRun(Prefix);
+    BD.EmitProgressBytecode("pass-error",  false);
     exit(1);
   }
 





More information about the llvm-commits mailing list