X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fbugpoint%2FToolRunner.cpp;h=107d0dbaeb17fb198021851c5626687df8f812ef;hb=1b0dc64919e947bb4f4677b138c734e33061f7c4;hp=4e6f6e27cca1ae95d1b639de4e29a93a6f225541;hpb=46fa7cf91af03373b6ab54f31215bb671698000f;p=oota-llvm.git diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index 4e6f6e27cca..107d0dbaeb1 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -18,7 +18,6 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/FileUtilities.h" -#include "llvm/Support/PathV1.h" #include "llvm/Support/Program.h" #include "llvm/Support/raw_ostream.h" #include @@ -142,8 +141,8 @@ static std::string ProcessFailure(StringRef ProgPath, const char** Args, // Rerun the compiler, capturing any error messages to print them. SmallString<128> ErrorFilename; int ErrorFD; - error_code EC = sys::fs::unique_file("bugpoint.program_error_messages", - ErrorFD, ErrorFilename); + error_code EC = sys::fs::createTemporaryFile( + "bugpoint.program_error_messages", "", ErrorFD, ErrorFilename); if (EC) { errs() << "Error making unique filename: " << EC.message() << "\n"; exit(1); @@ -252,8 +251,8 @@ static std::string PrependMainExecutablePath(const std::string &ExeName, // Check the directory that the calling program is in. We can do // this if ProgramPath contains at least one / character, indicating that it // is a relative path to the executable itself. - sys::Path Main = sys::Path::GetMainExecutable(Argv0, MainAddr); - StringRef Result = sys::path::parent_path(Main.str()); + std::string Main = sys::fs::getMainExecutable(Argv0, MainAddr); + StringRef Result = sys::path::parent_path(Main); if (!Result.empty()) { SmallString<128> Storage = Result; @@ -479,7 +478,7 @@ GCC::FileType LLC::OutputCode(const std::string &Bitcode, SmallString<128> UniqueFile; error_code EC = - sys::fs::unique_file(Bitcode + "-%%%%%%%" + Suffix, UniqueFile); + sys::fs::createUniqueFile(Bitcode + "-%%%%%%%" + Suffix, UniqueFile); if (EC) { errs() << "Error making unique filename: " << EC.message() << "\n"; exit(1); @@ -716,7 +715,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, SmallString<128> OutputBinary; error_code EC = - sys::fs::unique_file(ProgramFile+ "-%%%%%%%.gcc.exe", OutputBinary); + sys::fs::createUniqueFile(ProgramFile + "-%%%%%%%.gcc.exe", OutputBinary); if (EC) { errs() << "Error making unique filename: " << EC.message() << "\n"; exit(1); @@ -825,8 +824,8 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, const std::vector &ArgsForGCC, std::string &Error) { SmallString<128> UniqueFilename; - error_code EC = sys::fs::unique_file(InputFile + "-%%%%%%%" + LTDL_SHLIB_EXT, - UniqueFilename); + error_code EC = sys::fs::createUniqueFile( + InputFile + "-%%%%%%%" + LTDL_SHLIB_EXT, UniqueFilename); if (EC) { errs() << "Error making unique filename: " << EC.message() << "\n"; exit(1);