Be more helpful if a pass fails while chasing down a miscompilation
authorChris Lattner <sabre@nondot.org>
Fri, 17 Oct 2003 23:03:16 +0000 (23:03 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 17 Oct 2003 23:03:16 +0000 (23:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9214 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/BugDriver.h
tools/bugpoint/Miscompilation.cpp

index 532bbb590831330a077dc5e6fdf5cc890468d59c..43edf5c264f38a5a85e771ce2eef0d3ae5829865 100644 (file)
@@ -57,6 +57,9 @@ public:
   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 2ede067b1e0993df197a223042945ee54c3c2318..0e350d24dbf8fa59818073fed6b5765f340975d8 100644 (file)
@@ -57,8 +57,10 @@ ReduceMiscompilingPasses::doTest(std::vector<const PassInfo*> &Prefix,
   // 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 @@ ReduceMiscompilingPasses::doTest(std::vector<const PassInfo*> &Prefix,
   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);
   }