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

Chris Lattner lattner at cs.uiuc.edu
Thu Apr 24 22:17:06 PDT 2003


Changes in directory llvm/tools/bugpoint:

Miscompilation.cpp updated: 1.6 -> 1.7

---
Log message:

Rename Kept -> Suffix
Fix problem where we accidentally returned KeepPrefix instead of KeepSuffix!


---
Diffs of the changes:

Index: llvm/tools/bugpoint/Miscompilation.cpp
diff -u llvm/tools/bugpoint/Miscompilation.cpp:1.6 llvm/tools/bugpoint/Miscompilation.cpp:1.7
--- llvm/tools/bugpoint/Miscompilation.cpp:1.6	Thu Apr 24 17:24:22 2003
+++ llvm/tools/bugpoint/Miscompilation.cpp	Thu Apr 24 22:16:05 2003
@@ -38,14 +38,14 @@
 
 ReduceMiscompilingPasses::TestResult
 ReduceMiscompilingPasses::doTest(std::vector<const PassInfo*> &Prefix,
-                                 std::vector<const PassInfo*> &Kept) {
-  // First, run the program with just the Kept passes.  If it is still broken
+                                 std::vector<const PassInfo*> &Suffix) {
+  // First, run the program with just the Suffix passes.  If it is still broken
   // with JUST the kept passes, discard the prefix passes.
-  std::cout << "Checking to see if '" << getPassesString(Kept)
+  std::cout << "Checking to see if '" << getPassesString(Suffix)
             << "' compile correctly: ";
 
   std::string BytecodeResult;
-  if (BD.runPasses(Kept, BytecodeResult, false/*delete*/, true/*quiet*/)) {
+  if (BD.runPasses(Suffix, BytecodeResult, false/*delete*/, true/*quiet*/)) {
     std::cerr << BD.getToolName() << ": Error running this sequence of passes"
               << " on the input program!\n";
     exit(1);
@@ -60,8 +60,8 @@
 
   if (Prefix.empty()) return NoFailure;
 
-  // First, run the program with just the Kept passes.  If it is still broken
-  // with JUST the kept passes, discard the prefix passes.
+  // Next, see if the program is broken if we run the "prefix" passes first,
+  // then seperately run the "kept" passes.
   std::cout << "Checking to see if '" << getPassesString(Prefix)
             << "' compile correctly: ";
 
@@ -96,13 +96,13 @@
   }
   removeFile(BytecodeResult);  // No longer need the file on disk
     
-  std::cout << "Checking to see if '" << getPassesString(Kept)
+  std::cout << "Checking to see if '" << getPassesString(Suffix)
             << "' passes compile correctly after the '"
             << getPassesString(Prefix) << "' passes: ";
 
   Module *OriginalInput = BD.Program;
   BD.Program = PrefixOutput;
-  if (BD.runPasses(Kept, BytecodeResult, false/*delete*/, true/*quiet*/)) {
+  if (BD.runPasses(Suffix, BytecodeResult, false/*delete*/, true/*quiet*/)) {
     std::cerr << BD.getToolName() << ": Error running this sequence of passes"
               << " on the input program!\n";
     exit(1);
@@ -112,7 +112,7 @@
   if (BD.diffProgram(Output, BytecodeResult, true/*delete bytecode*/)) {
     std::cout << "nope.\n";
     delete OriginalInput;     // We pruned down the original input...
-    return KeepPrefix;
+    return KeepSuffix;
   }
 
   // Otherwise, we must not be running the bad pass anymore.
@@ -136,8 +136,8 @@
   ReduceMiscompilingFunctions(BugDriver &bd) : BD(bd) {}
 
   virtual TestResult doTest(std::vector<Function*> &Prefix,
-                            std::vector<Function*> &Kept) {
-    if (TestFuncs(Kept, false))
+                            std::vector<Function*> &Suffix) {
+    if (TestFuncs(Suffix, false))
       return KeepSuffix;
     if (!Prefix.empty() && TestFuncs(Prefix, false))
       return KeepPrefix;





More information about the llvm-commits mailing list