Remove the 'N' modifier from llvm-ar.
[oota-llvm.git] / tools / bugpoint / CrashDebugger.cpp
index 8129b2bc76e2d9d84d47054a7f55d761b545d271..c8b4f6f73e92b77daa6797f4e39d8048a2001d30 100644 (file)
 //===----------------------------------------------------------------------===//
 
 #include "BugDriver.h"
-#include "ToolRunner.h"
 #include "ListReducer.h"
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/Instructions.h"
-#include "llvm/Module.h"
-#include "llvm/Pass.h"
-#include "llvm/PassManager.h"
-#include "llvm/ValueSymbolTable.h"
+#include "ToolRunner.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/Analysis/Verifier.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/DerivedTypes.h"
+#include "llvm/IR/Instructions.h"
+#include "llvm/IR/Module.h"
+#include "llvm/IR/ValueSymbolTable.h"
+#include "llvm/Pass.h"
+#include "llvm/PassManager.h"
 #include "llvm/Support/CFG.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/FileUtilities.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/Cloning.h"
-#include "llvm/Support/FileUtilities.h"
-#include "llvm/Support/CommandLine.h"
 #include <set>
 using namespace llvm;
 
@@ -48,7 +48,7 @@ namespace llvm {
   public:
     ReducePassList(BugDriver &bd) : BD(bd) {}
 
-    // doTest - Return true if running the "removed" passes succeeds, and
+    // doTest - Return true iff running the "removed" passes succeeds, and
     // running the "Kept" passes fail when run on the output of the "removed"
     // passes.  If we return true, we update the current module of bugpoint.
     //
@@ -62,25 +62,23 @@ ReducePassList::TestResult
 ReducePassList::doTest(std::vector<std::string> &Prefix,
                        std::vector<std::string> &Suffix,
                        std::string &Error) {
-  sys::Path PrefixOutput;
+  std::string PrefixOutput;
   Module *OrigProgram = 0;
   if (!Prefix.empty()) {
     outs() << "Checking to see if these passes crash: "
            << getPassesString(Prefix) << ": ";
-    std::string PfxOutput;
-    if (BD.runPasses(BD.getProgram(), Prefix, PfxOutput))
+    if (BD.runPasses(BD.getProgram(), Prefix, PrefixOutput))
       return KeepPrefix;
 
-    PrefixOutput.set(PfxOutput);
     OrigProgram = BD.Program;
 
-    BD.Program = ParseInputFile(PrefixOutput.str(), BD.getContext());
+    BD.Program = ParseInputFile(PrefixOutput, BD.getContext());
     if (BD.Program == 0) {
       errs() << BD.getToolName() << ": Error reading bitcode file '"
-             << PrefixOutput.str() << "'!\n";
+             << PrefixOutput << "'!\n";
       exit(1);
     }
-    PrefixOutput.eraseFromDisk();
+    sys::fs::remove(PrefixOutput);
   }
 
   outs() << "Checking to see if these passes crash: "