Substantial cleanups:
[oota-llvm.git] / tools / bugpoint / Miscompilation.cpp
index b65b4a6a678b86cbb0921c356ba3329f6b41fa38..2ede067b1e0993df197a223042945ee54c3c2318 100644 (file)
@@ -5,12 +5,12 @@
 //===----------------------------------------------------------------------===//
 
 #include "BugDriver.h"
-#include "SystemUtils.h"
 #include "ListReducer.h"
-#include "llvm/Pass.h"
 #include "llvm/Module.h"
+#include "llvm/Pass.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 #include "llvm/Transforms/Utils/Linker.h"
+#include "Support/FileUtilities.h"
 
 class ReduceMiscompilingPasses : public ListReducer<const PassInfo*> {
   BugDriver &BD;
@@ -114,7 +114,7 @@ public:
 
   virtual TestResult doTest(std::vector<Function*> &Prefix,
                             std::vector<Function*> &Suffix) {
-    if (TestFuncs(Suffix, false))
+    if (!Suffix.empty() && TestFuncs(Suffix, false))
       return KeepSuffix;
     if (!Prefix.empty() && TestFuncs(Prefix, false))
       return KeepPrefix;
@@ -261,13 +261,6 @@ bool ReduceMiscompilingFunctions::TestFuncs(const std::vector<Function*> &Funcs,
 /// input.
 ///
 bool BugDriver::debugMiscompilation() {
-
-  if (diffProgram()) {
-    std::cout << "\n*** Input program does not match reference diff!\n"
-              << "    Must be problem with input source!\n";
-    return false;  // Problem found
-  }
-
   // Make sure something was miscompiled...
   if (!ReduceMiscompilingPasses(*this).reduceList(PassesToRun)) {
     std::cerr << "*** Optimized program matches reference output!  No problem "