[llvm-commits] CVS: llvm/tools/bugpoint/CrashDebugger.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Apr 24 17:55:01 PDT 2003


Changes in directory llvm/tools/bugpoint:

CrashDebugger.cpp updated: 1.6 -> 1.7

---
Log message:

The big fix is this change:
-    if (I->isExternal() && !Functions.count(I))
+    if (!I->isExternal() && !Functions.count(I))

We were not actually deleting any functions from the module!



---
Diffs of the changes:

Index: llvm/tools/bugpoint/CrashDebugger.cpp
diff -u llvm/tools/bugpoint/CrashDebugger.cpp:1.6 llvm/tools/bugpoint/CrashDebugger.cpp:1.7
--- llvm/tools/bugpoint/CrashDebugger.cpp:1.6	Thu Apr 24 17:24:58 2003
+++ llvm/tools/bugpoint/CrashDebugger.cpp	Thu Apr 24 17:54:06 2003
@@ -87,7 +87,7 @@
     Function *CMF = M->getFunction(Funcs[i]->getName(), 
                                    Funcs[i]->getFunctionType());
     assert(CMF && "Function not in module?!");
-    Functions.insert(CMF);    
+    Functions.insert(CMF);
   }
 
   std::cout << "Checking for crash with only these functions:";
@@ -98,7 +98,7 @@
   // Loop over and delete any functions which we aren't supposed to be playing
   // with...
   for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
-    if (I->isExternal() && !Functions.count(I))
+    if (!I->isExternal() && !Functions.count(I))
       DeleteFunctionBody(I);
 
   // Try running the hacked up program...
@@ -129,11 +129,6 @@
   unsigned OldSize = PassesToRun.size();
   DebugCrashes(*this).reduceList(PassesToRun);
 
-  if (PassesToRun.size() == OldSize) { // Make sure something crashed.  :)
-    std::cerr << "ERROR: No passes crashed!\n";
-    return true;
-  }
-
   std::cout << "\n*** Found crashing pass"
             << (PassesToRun.size() == 1 ? ": " : "es: ")
             << getPassesString(PassesToRun) << "\n";
@@ -164,7 +159,6 @@
 
   // FIXME: This should use the list reducer to converge faster by deleting
   // larger chunks of instructions at a time!
-  bool Reduced = false;
   unsigned Simplification = 4;
   do {
     --Simplification;
@@ -200,7 +194,7 @@
               // Yup, it does, we delete the old module, and continue trying to
               // reduce the testcase...
               delete M;
-              Reduced = AnyReduction = true;
+              AnyReduction = true;
               goto TryAgain;  // I wish I had a multi-level break here!
             }
             
@@ -222,17 +216,15 @@
     if (runPasses(PassesToRun)) {
       // Yup, it does, keep the reduced version...
       delete M;
-      Reduced = AnyReduction = true;
+      AnyReduction = true;
     } else {
       delete Program;   // Otherwise, restore the original module...
       Program = M;
     }
   }
 
-  if (Reduced) {
+  if (AnyReduction)
     EmitProgressBytecode("reduced-simplified");
-    Reduced = false;
-  }
 
   return false;
 }





More information about the llvm-commits mailing list