X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fbugpoint%2FCrashDebugger.cpp;h=c8b4f6f73e92b77daa6797f4e39d8048a2001d30;hb=1b0dc64919e947bb4f4677b138c734e33061f7c4;hp=8836eedb47684454684bea7122836a384137202a;hpb=40b6fdb81e12b40dd41c9f9f07befb60ec7291c3;p=oota-llvm.git diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index 8836eedb476..c8b4f6f73e9 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -12,22 +12,22 @@ //===----------------------------------------------------------------------===// #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 using namespace llvm; @@ -62,25 +62,23 @@ ReducePassList::TestResult ReducePassList::doTest(std::vector &Prefix, std::vector &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: " @@ -412,9 +410,7 @@ bool ReduceCrashingInstructions::TestInsts(std::vector // Verify that this is still valid. PassManager Passes; Passes.add(createVerifierPass()); - Passes.doInitialization(); Passes.run(*M); - Passes.doFinalization(); // Try running on the hacked up program... if (TestFn(BD, M)) {