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

Chris Lattner lattner at cs.uiuc.edu
Thu Apr 24 14:33:01 PDT 2003


Changes in directory llvm/tools/bugpoint:

Miscompilation.cpp updated: 1.3 -> 1.4

---
Log message:

Allow bugpoint to try new an different methods for pruning down lists


---
Diffs of the changes:

Index: llvm/tools/bugpoint/Miscompilation.cpp
diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.3 llvm/tools/bugpoint/Miscompilation.cpp:1.4
--- llvm/tools/bugpoint/Miscompilation.cpp:1.3	Thu Apr 24 12:02:17 2003
+++ llvm/tools/bugpoint/Miscompilation.cpp	Thu Apr 24 14:32:42 2003
@@ -72,6 +72,30 @@
         break;
       }
     }
+
+    // Okay, we trimmed as much off the top and the bottom of the list as we
+    // could.  If there is more two elements in the list, try deleting interior
+    // elements and testing that.
+    //
+    if (TheList.size() > 2) {
+      bool Changed = true;
+      std::vector<ElTy> EmptyList;
+      while (Changed) {
+        Changed = false;
+        std::vector<ElTy> TrimmedList;
+        for (unsigned i = 1; i < TheList.size()-1; ++i) { // Check interior elts
+          std::vector<ElTy> TestList(TheList);
+          TestList.erase(TestList.begin()+i);
+
+          if (doTest(EmptyList, TestList) == KeepSuffix) {
+            // We can trim down the list!
+            TheList.swap(TestList);
+            --i;  // Don't skip an element of the list
+            Changed = true;
+          }
+        }
+      }
+    }
   }
 };
 
@@ -187,7 +211,7 @@
                             const std::vector<Function*> &Kept) {
     if (TestFuncs(Kept, false))
       return KeepSuffix;
-    if (TestFuncs(Prefix, false))
+    if (!Prefix.empty() && TestFuncs(Prefix, false))
       return KeepPrefix;
     return NoFailure;
   }





More information about the llvm-commits mailing list