summaryrefslogtreecommitdiff
path: root/tools/bugpoint
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-12 20:58:35 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-12 20:58:35 +0000
commit9f1d9fd1964d82f3e801efb71518144492cdf290 (patch)
treefb6a689c0275a2c77086b695db3b5065ce454bf2 /tools/bugpoint
parent7e17024400941889b6fe1b178e5374f75c34d9ab (diff)
downloadllvm-9f1d9fd1964d82f3e801efb71518144492cdf290.tar.gz
llvm-9f1d9fd1964d82f3e801efb71518144492cdf290.tar.bz2
llvm-9f1d9fd1964d82f3e801efb71518144492cdf290.tar.xz
Remove the program class.
It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just those two functions and make Execute and Wait implementations details. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183864 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint')
-rw-r--r--tools/bugpoint/OptimizerDriver.cpp10
-rw-r--r--tools/bugpoint/ToolRunner.cpp15
2 files changed, 12 insertions, 13 deletions
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp
index 87dc9f332c..6c491ff0f9 100644
--- a/tools/bugpoint/OptimizerDriver.cpp
+++ b/tools/bugpoint/OptimizerDriver.cpp
@@ -148,7 +148,7 @@ bool BugDriver::runPasses(Module *Program,
return 1;
}
- sys::Path tool = sys::Program::FindProgramByName("opt");
+ sys::Path tool = sys::FindProgramByName("opt");
if (tool.empty()) {
errs() << "Cannot find `opt' in PATH!\n";
return 1;
@@ -196,7 +196,7 @@ bool BugDriver::runPasses(Module *Program,
sys::Path prog;
if (UseValgrind)
- prog = sys::Program::FindProgramByName("valgrind");
+ prog = sys::FindProgramByName("valgrind");
else
prog = tool;
@@ -204,9 +204,9 @@ bool BugDriver::runPasses(Module *Program,
sys::Path Nowhere;
const sys::Path *Redirects[3] = {0, &Nowhere, &Nowhere};
- int result = sys::Program::ExecuteAndWait(prog, Args.data(), 0,
- (SilencePasses ? Redirects : 0),
- Timeout, MemoryLimit, &ErrMsg);
+ int result =
+ sys::ExecuteAndWait(prog, 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 735061d8bc..54a48111f8 100644
--- a/tools/bugpoint/ToolRunner.cpp
+++ b/tools/bugpoint/ToolRunner.cpp
@@ -75,9 +75,8 @@ static int RunProgramWithTimeout(const sys::Path &ProgramPath,
}
#endif
- return
- sys::Program::ExecuteAndWait(ProgramPath, Args, 0, redirects,
- NumSeconds, MemoryLimit, ErrMsg);
+ return sys::ExecuteAndWait(ProgramPath, Args, 0, redirects, NumSeconds,
+ MemoryLimit, ErrMsg);
}
/// RunProgramRemotelyWithTimeout - This function runs the given program
@@ -108,8 +107,8 @@ static int RunProgramRemotelyWithTimeout(const sys::Path &RemoteClientPath,
#endif
// Run the program remotely with the remote client
- int ReturnCode = sys::Program::ExecuteAndWait(RemoteClientPath, Args,
- 0, redirects, NumSeconds, MemoryLimit);
+ int ReturnCode = sys::ExecuteAndWait(RemoteClientPath, Args, 0, redirects,
+ NumSeconds, MemoryLimit);
// Has the remote client fail?
if (255 == ReturnCode) {
@@ -398,7 +397,7 @@ static void lexCommand(std::string &Message, const std::string &CommandLine,
pos = CommandLine.find_first_of(delimiters, lastPos);
}
- CmdPath = sys::Program::FindProgramByName(Command).str();
+ CmdPath = sys::FindProgramByName(Command).str();
if (CmdPath.empty()) {
Message =
std::string("Cannot find '") + Command +
@@ -875,7 +874,7 @@ int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType,
GCC *GCC::create(std::string &Message,
const std::string &GCCBinary,
const std::vector<std::string> *Args) {
- sys::Path GCCPath = sys::Program::FindProgramByName(GCCBinary);
+ sys::Path GCCPath = sys::FindProgramByName(GCCBinary);
if (GCCPath.isEmpty()) {
Message = "Cannot find `"+ GCCBinary +"' in PATH!\n";
return 0;
@@ -883,7 +882,7 @@ GCC *GCC::create(std::string &Message,
sys::Path RemoteClientPath;
if (!RemoteClient.empty())
- RemoteClientPath = sys::Program::FindProgramByName(RemoteClient);
+ RemoteClientPath = sys::FindProgramByName(RemoteClient);
Message = "Found gcc: " + GCCPath.str() + "\n";
return new GCC(GCCPath, RemoteClientPath, Args);