From f656a1d4991e52725f73308ee829ffce812c96d1 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 17 Jun 2013 19:21:38 +0000 Subject: Don't use PathV1.h in ToolRunner.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184107 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/BugDriver.cpp | 1 + tools/bugpoint/CrashDebugger.cpp | 1 + tools/bugpoint/ExecutionDriver.cpp | 7 ++++--- tools/bugpoint/FindBugs.cpp | 1 + tools/bugpoint/Miscompilation.cpp | 1 + tools/bugpoint/ToolRunner.cpp | 15 ++++++++------- tools/bugpoint/ToolRunner.h | 5 ++--- 7 files changed, 18 insertions(+), 13 deletions(-) (limited to 'tools') diff --git a/tools/bugpoint/BugDriver.cpp b/tools/bugpoint/BugDriver.cpp index 937d86a5b8..9cbad0bd16 100644 --- a/tools/bugpoint/BugDriver.cpp +++ b/tools/bugpoint/BugDriver.cpp @@ -22,6 +22,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/Host.h" +#include "llvm/Support/PathV1.h" #include "llvm/Support/SourceMgr.h" #include "llvm/Support/raw_ostream.h" #include diff --git a/tools/bugpoint/CrashDebugger.cpp b/tools/bugpoint/CrashDebugger.cpp index ed211a6008..ec4d0b29d7 100644 --- a/tools/bugpoint/CrashDebugger.cpp +++ b/tools/bugpoint/CrashDebugger.cpp @@ -26,6 +26,7 @@ #include "llvm/Support/CFG.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileUtilities.h" +#include "llvm/Support/PathV1.h" #include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Utils/Cloning.h" #include diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index fd0cc5988f..5490115598 100644 --- a/tools/bugpoint/ExecutionDriver.cpp +++ b/tools/bugpoint/ExecutionDriver.cpp @@ -17,6 +17,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/FileUtilities.h" +#include "llvm/Support/PathV1.h" #include "llvm/Support/SystemUtils.h" #include "llvm/Support/raw_ostream.h" #include @@ -380,7 +381,7 @@ std::string BugDriver::executeProgramSafely(const Module *Program, std::string BugDriver::compileSharedObject(const std::string &BitcodeFile, std::string &Error) { assert(Interpreter && "Interpreter should have been created already!"); - sys::Path OutputFile; + std::string OutputFile; // Using the known-good backend. GCC::FileType FT = SafeInterpreter->OutputCode(BitcodeFile, OutputFile, @@ -389,7 +390,7 @@ std::string BugDriver::compileSharedObject(const std::string &BitcodeFile, return ""; std::string SharedObjectFile; - bool Failure = gcc->MakeSharedObject(OutputFile.str(), FT, SharedObjectFile, + bool Failure = gcc->MakeSharedObject(OutputFile, FT, SharedObjectFile, AdditionalLinkerArgs, Error); if (!Error.empty()) return ""; @@ -397,7 +398,7 @@ std::string BugDriver::compileSharedObject(const std::string &BitcodeFile, exit(1); // Remove the intermediate C file - OutputFile.eraseFromDisk(); + sys::fs::remove(OutputFile); return "./" + SharedObjectFile; } diff --git a/tools/bugpoint/FindBugs.cpp b/tools/bugpoint/FindBugs.cpp index a291f9fb0f..bb6637edfb 100644 --- a/tools/bugpoint/FindBugs.cpp +++ b/tools/bugpoint/FindBugs.cpp @@ -17,6 +17,7 @@ #include "BugDriver.h" #include "ToolRunner.h" #include "llvm/Pass.h" +#include "llvm/Support/PathV1.h" #include "llvm/Support/raw_ostream.h" #include #include diff --git a/tools/bugpoint/Miscompilation.cpp b/tools/bugpoint/Miscompilation.cpp index 11ac0de104..a17d07ab7b 100644 --- a/tools/bugpoint/Miscompilation.cpp +++ b/tools/bugpoint/Miscompilation.cpp @@ -25,6 +25,7 @@ #include "llvm/Pass.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileUtilities.h" +#include "llvm/Support/PathV1.h" #include "llvm/Transforms/Utils/Cloning.h" using namespace llvm; diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index a79248d3f7..70cfd36cb1 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -17,6 +17,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/FileUtilities.h" +#include "llvm/Support/PathV1.h" #include "llvm/Support/Program.h" #include "llvm/Support/raw_ostream.h" #include @@ -460,7 +461,7 @@ AbstractInterpreter *AbstractInterpreter::createCustomExecutor( // LLC Implementation of AbstractIntepreter interface // GCC::FileType LLC::OutputCode(const std::string &Bitcode, - sys::Path &OutputAsmFile, std::string &Error, + std::string &OutputAsmFile, std::string &Error, unsigned Timeout, unsigned MemoryLimit) { const char *Suffix = (UseIntegratedAssembler ? ".llc.o" : ".llc.s"); sys::Path uniqueFile(Bitcode + Suffix); @@ -469,7 +470,7 @@ GCC::FileType LLC::OutputCode(const std::string &Bitcode, errs() << "Error making unique filename: " << ErrMsg << "\n"; exit(1); } - OutputAsmFile = uniqueFile; + OutputAsmFile = uniqueFile.str(); std::vector LLCArgs; LLCArgs.push_back(LLCPath.c_str()); @@ -503,9 +504,9 @@ GCC::FileType LLC::OutputCode(const std::string &Bitcode, void LLC::compileProgram(const std::string &Bitcode, std::string *Error, unsigned Timeout, unsigned MemoryLimit) { - sys::Path OutputAsmFile; + std::string OutputAsmFile; OutputCode(Bitcode, OutputAsmFile, *Error, Timeout, MemoryLimit); - OutputAsmFile.eraseFromDisk(); + sys::fs::remove(OutputAsmFile); } int LLC::ExecuteProgram(const std::string &Bitcode, @@ -518,16 +519,16 @@ int LLC::ExecuteProgram(const std::string &Bitcode, unsigned Timeout, unsigned MemoryLimit) { - sys::Path OutputAsmFile; + std::string OutputAsmFile; GCC::FileType FileKind = OutputCode(Bitcode, OutputAsmFile, *Error, Timeout, MemoryLimit); - FileRemover OutFileRemover(OutputAsmFile.str(), !SaveTemps); + FileRemover OutFileRemover(OutputAsmFile, !SaveTemps); std::vector GCCArgs(ArgsForGCC); GCCArgs.insert(GCCArgs.end(), SharedLibs.begin(), SharedLibs.end()); // Assuming LLC worked, compile the result with GCC and run it. - return gcc->ExecuteProgram(OutputAsmFile.str(), Args, FileKind, + return gcc->ExecuteProgram(OutputAsmFile, Args, FileKind, InputFile, OutputFile, Error, GCCArgs, Timeout, MemoryLimit); } diff --git a/tools/bugpoint/ToolRunner.h b/tools/bugpoint/ToolRunner.h index 80416d8a39..bc2be46b32 100644 --- a/tools/bugpoint/ToolRunner.h +++ b/tools/bugpoint/ToolRunner.h @@ -21,7 +21,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/Path.h" -#include "llvm/Support/PathV1.h" #include "llvm/Support/SystemUtils.h" #include #include @@ -122,7 +121,7 @@ public: /// fails, it sets Error, otherwise, this function returns the type of code /// emitted. virtual GCC::FileType OutputCode(const std::string &Bitcode, - sys::Path &OutFile, std::string &Error, + std::string &OutFile, std::string &Error, unsigned Timeout = 0, unsigned MemoryLimit = 0) { Error = "OutputCode not supported by this AbstractInterpreter!"; @@ -189,7 +188,7 @@ public: /// fails, it sets Error, otherwise, this function returns the type of code /// emitted. virtual GCC::FileType OutputCode(const std::string &Bitcode, - sys::Path &OutFile, std::string &Error, + std::string &OutFile, std::string &Error, unsigned Timeout = 0, unsigned MemoryLimit = 0); }; -- cgit v1.2.3