summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-13 19:25:37 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-13 19:25:37 +0000
commit6585b388cb7bfc623adb9e4dd910423f838e5d96 (patch)
treedc0ff4c6888d3a35bc3dec2152d921fd929e4008 /tools
parent90cd06e90be1db06bc4812ae9ec96b6638847285 (diff)
downloadllvm-6585b388cb7bfc623adb9e4dd910423f838e5d96.tar.gz
llvm-6585b388cb7bfc623adb9e4dd910423f838e5d96.tar.bz2
llvm-6585b388cb7bfc623adb9e4dd910423f838e5d96.tar.xz
Have sys::FindProgramByName return a std::string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/bugpoint/OptimizerDriver.cpp5
-rw-r--r--tools/bugpoint/ToolRunner.cpp12
2 files changed, 8 insertions, 9 deletions
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp
index 6c491ff0f9..4c9219a71b 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::FindProgramByName("opt");
+ std::string tool = sys::FindProgramByName("opt");
if (tool.empty()) {
errs() << "Cannot find `opt' in PATH!\n";
return 1;
@@ -159,14 +159,13 @@ bool BugDriver::runPasses(Module *Program,
// setup the child process' arguments
SmallVector<const char*, 8> Args;
- std::string Opt = tool.str();
if (UseValgrind) {
Args.push_back("valgrind");
Args.push_back("--error-exitcode=1");
Args.push_back("-q");
Args.push_back(tool.c_str());
} else
- Args.push_back(Opt.c_str());
+ Args.push_back(tool.c_str());
Args.push_back("-o");
Args.push_back(OutputFilename.c_str());
diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp
index 00f14f4fd0..30db4b59dc 100644
--- a/tools/bugpoint/ToolRunner.cpp
+++ b/tools/bugpoint/ToolRunner.cpp
@@ -400,7 +400,7 @@ static void lexCommand(std::string &Message, const std::string &CommandLine,
pos = CommandLine.find_first_of(delimiters, lastPos);
}
- CmdPath = sys::FindProgramByName(Command).str();
+ CmdPath = sys::FindProgramByName(Command);
if (CmdPath.empty()) {
Message =
std::string("Cannot find '") + Command +
@@ -875,16 +875,16 @@ 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::FindProgramByName(GCCBinary);
- if (GCCPath.isEmpty()) {
+ std::string GCCPath = sys::FindProgramByName(GCCBinary);
+ if (GCCPath.empty()) {
Message = "Cannot find `"+ GCCBinary +"' in PATH!\n";
return 0;
}
- sys::Path RemoteClientPath;
+ std::string RemoteClientPath;
if (!RemoteClient.empty())
RemoteClientPath = sys::FindProgramByName(RemoteClient);
- Message = "Found gcc: " + GCCPath.str() + "\n";
- return new GCC(GCCPath.str(), RemoteClientPath.str(), Args);
+ Message = "Found gcc: " + GCCPath + "\n";
+ return new GCC(GCCPath, RemoteClientPath, Args);
}