diff options
author | Chris Lattner <sabre@nondot.org> | 2005-08-02 02:16:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-08-02 02:16:17 +0000 |
commit | beb01faea36b59a5b15ce92126b1ec371d2af1b2 (patch) | |
tree | 4b1f9671027ef526ef897cf81fed7be323e8caed /llvm/tools/bugpoint/Miscompilation.cpp | |
parent | 6a5d6ecd092f856b545a9a5b060d253a4cd4abb5 (diff) | |
download | bcm5719-llvm-beb01faea36b59a5b15ce92126b1ec371d2af1b2.tar.gz bcm5719-llvm-beb01faea36b59a5b15ce92126b1ec371d2af1b2.zip |
When the user hits ctrl-c, bugpoint should attempt to stop reduction as
quickly as possible and output what it has so far. If they hit it twice,
bugpoint is killed.
llvm-svn: 22579
Diffstat (limited to 'llvm/tools/bugpoint/Miscompilation.cpp')
-rw-r--r-- | llvm/tools/bugpoint/Miscompilation.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/llvm/tools/bugpoint/Miscompilation.cpp b/llvm/tools/bugpoint/Miscompilation.cpp index dc43126670c..834e6879958 100644 --- a/llvm/tools/bugpoint/Miscompilation.cpp +++ b/llvm/tools/bugpoint/Miscompilation.cpp @@ -407,6 +407,8 @@ bool ReduceMiscompiledBlocks::TestFuncs(const std::vector<BasicBlock*> &BBs) { static bool ExtractBlocks(BugDriver &BD, bool (*TestFn)(BugDriver &, Module *, Module *), std::vector<Function*> &MiscompiledFunctions) { + if (BugpointIsInterrupted) return false; + std::vector<BasicBlock*> Blocks; for (unsigned i = 0, e = MiscompiledFunctions.size(); i != e; ++i) for (Function::iterator I = MiscompiledFunctions[i]->begin(), @@ -493,7 +495,8 @@ DebugAMiscompilation(BugDriver &BD, MiscompiledFunctions.push_back(I); // Do the reduction... - ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions); + if (!BugpointIsInterrupted) + ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions); std::cout << "\n*** The following function" << (MiscompiledFunctions.size() == 1 ? " is" : "s are") @@ -513,7 +516,8 @@ DebugAMiscompilation(BugDriver &BD, DisambiguateGlobalSymbols(BD.getProgram()); // Do the reduction... - ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions); + if (!BugpointIsInterrupted) + ReduceMiscompilingFunctions(BD, TestFn).reduceList(MiscompiledFunctions); std::cout << "\n*** The following function" << (MiscompiledFunctions.size() == 1 ? " is" : "s are") @@ -570,11 +574,12 @@ static bool TestOptimizer(BugDriver &BD, Module *Test, Module *Safe) { /// bool BugDriver::debugMiscompilation() { // Make sure something was miscompiled... - if (!ReduceMiscompilingPasses(*this).reduceList(PassesToRun)) { - std::cerr << "*** Optimized program matches reference output! No problem " - << "detected...\nbugpoint can't help you with your problem!\n"; - return false; - } + if (!BugpointIsInterrupted) + if (!ReduceMiscompilingPasses(*this).reduceList(PassesToRun)) { + std::cerr << "*** Optimized program matches reference output! No problem" + << " detected...\nbugpoint can't help you with your problem!\n"; + return false; + } std::cout << "\n*** Found miscompiling pass" << (getPassesToRun().size() == 1 ? "" : "es") << ": " @@ -663,7 +668,7 @@ static void CleanupAndPrepareModules(BugDriver &BD, Module *&Test, for (Module::iterator F = Safe->begin(), E = Safe->end(); F != E; ++F) { if (F->isExternal() && !F->use_empty() && &*F != resolverFunc && F->getIntrinsicID() == 0 /* ignore intrinsics */) { - Function *TestFn = Test->getFunction(F->getName(), F->getFunctionType()); + Function *TestFn = Test->getNamedFunction(F->getName()); // Don't forward functions which are external in the test module too. if (TestFn && !TestFn->isExternal()) { |