diff --git a/tools/bugpoint/BugDriver.h b/tools/bugpoint/BugDriver.h index 532bbb59083..43edf5c264f 100644 --- a/tools/bugpoint/BugDriver.h +++ b/tools/bugpoint/BugDriver.h @@ -57,6 +57,9 @@ public: bool addSources(const std::vector &FileNames); template void addPasses(It I, It E) { PassesToRun.insert(PassesToRun.end(), I, E); } + void setPassesToRun(const std::vector &PTR) { + PassesToRun = PTR; + } /// run - The top level method that is invoked after all of the instance /// variables are set up from command line arguments. diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index 2ede067b1e0..0e350d24dbf 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -57,8 +57,10 @@ ReduceMiscompilingPasses::doTest(std::vector &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 &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); }