If the user interrupts bugpoint, don't extract loops
authorChris Lattner <sabre@nondot.org>
Tue, 2 Aug 2005 23:25:56 +0000 (23:25 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 2 Aug 2005 23:25:56 +0000 (23:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22603 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/Miscompilation.cpp

index 834e687995871c42f6f6c0ec0481bc2fbd416b50..39f83d03396efafb0ae71ade1f6dd1d5de9f5549 100644 (file)
@@ -247,6 +247,8 @@ static bool ExtractLoops(BugDriver &BD,
                          std::vector<Function*> &MiscompiledFunctions) {
   bool MadeChange = false;
   while (1) {
+    if (BugpointIsInterrupted) return MadeChange;
+    
     Module *ToNotOptimize = CloneModule(BD.getProgram());
     Module *ToOptimize = SplitFunctionsOutOfModule(ToNotOptimize,
                                                    MiscompiledFunctions);
@@ -506,7 +508,8 @@ DebugAMiscompilation(BugDriver &BD,
 
   // See if we can rip any loops out of the miscompiled functions and still
   // trigger the problem.
-  if (ExtractLoops(BD, TestFn, MiscompiledFunctions)) {
+  if (!BugpointIsInterrupted && 
+      ExtractLoops(BD, TestFn, MiscompiledFunctions)) {
     // Okay, we extracted some loops and the problem still appears.  See if we
     // can eliminate some of the created functions from being candidates.
 
@@ -526,7 +529,8 @@ DebugAMiscompilation(BugDriver &BD,
     std::cout << '\n';
   }
 
-  if (ExtractBlocks(BD, TestFn, MiscompiledFunctions)) {
+  if (!BugpointIsInterrupted &&
+      ExtractBlocks(BD, TestFn, MiscompiledFunctions)) {
     // Okay, we extracted some blocks and the problem still appears.  See if we
     // can eliminate some of the created functions from being candidates.