From 675e0ac0bfd6fb78423d9fbee9f50c1dec62c111 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 13 Jun 2013 20:25:38 +0000 Subject: Avoid using PathV1.h in Program.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183940 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/OptimizerDriver.cpp | 10 +++++----- tools/bugpoint/ToolRunner.cpp | 18 +++++------------- 2 files changed, 10 insertions(+), 18 deletions(-) (limited to 'tools/bugpoint') diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp index 4c9219a71b..6d96330c9e 100644 --- a/tools/bugpoint/OptimizerDriver.cpp +++ b/tools/bugpoint/OptimizerDriver.cpp @@ -200,12 +200,12 @@ bool BugDriver::runPasses(Module *Program, prog = tool; // Redirect stdout and stderr to nowhere if SilencePasses is given - sys::Path Nowhere; - const sys::Path *Redirects[3] = {0, &Nowhere, &Nowhere}; + StringRef Nowhere; + const StringRef *Redirects[3] = {0, &Nowhere, &Nowhere}; - int result = - sys::ExecuteAndWait(prog, Args.data(), 0, (SilencePasses ? Redirects : 0), - Timeout, MemoryLimit, &ErrMsg); + int result = sys::ExecuteAndWait(prog.str(), Args.data(), 0, + (SilencePasses ? Redirects : 0), Timeout, + MemoryLimit, &ErrMsg); // If we are supposed to delete the bitcode file or if the passes crashed, // remove it now. This may fail if the file was never created, but that's ok. diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index 30db4b59dc..0fea9788a6 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -61,11 +61,7 @@ static int RunProgramWithTimeout(StringRef ProgramPath, unsigned NumSeconds = 0, unsigned MemoryLimit = 0, std::string *ErrMsg = 0) { - const sys::Path P[3] = { sys::Path(StdInFile), sys::Path(StdOutFile), - sys::Path(StdErrFile) }; - const sys::Path* redirects[3]; - for (int I = 0; I < 3; ++I) - redirects[I] = &P[I]; + const StringRef *Redirects[3] = { &StdInFile, &StdOutFile, &StdErrFile }; #if 0 // For debug purposes { @@ -76,7 +72,7 @@ static int RunProgramWithTimeout(StringRef ProgramPath, } #endif - return sys::ExecuteAndWait(sys::Path(ProgramPath), Args, 0, redirects, + return sys::ExecuteAndWait(ProgramPath, Args, 0, Redirects, NumSeconds, MemoryLimit, ErrMsg); } @@ -93,11 +89,7 @@ static int RunProgramRemotelyWithTimeout(StringRef RemoteClientPath, StringRef StdErrFile, unsigned NumSeconds = 0, unsigned MemoryLimit = 0) { - const sys::Path P[3] = { sys::Path(StdInFile), sys::Path(StdOutFile), - sys::Path(StdErrFile) }; - const sys::Path* redirects[3]; - for (int I = 0; I < 3; ++I) - redirects[I] = &P[I]; + const StringRef *Redirects[3] = { &StdInFile, &StdOutFile, &StdErrFile }; #if 0 // For debug purposes { @@ -109,8 +101,8 @@ static int RunProgramRemotelyWithTimeout(StringRef RemoteClientPath, #endif // Run the program remotely with the remote client - int ReturnCode = sys::ExecuteAndWait(sys::Path(RemoteClientPath), Args, 0, - redirects, NumSeconds, MemoryLimit); + int ReturnCode = sys::ExecuteAndWait(RemoteClientPath, Args, 0, + Redirects, NumSeconds, MemoryLimit); // Has the remote client fail? if (255 == ReturnCode) { -- cgit v1.2.3