summaryrefslogtreecommitdiff
path: root/tools/lli
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-01-22 21:52:35 +0000
committerAlp Toker <alp@nuanti.com>2014-01-22 21:52:35 +0000
commit1214e71d771ca1083b5cb7d12e515d10b6537db2 (patch)
tree0cb4f992a2cf4ee64867ca01d4224bc63d9d4429 /tools/lli
parent4bcb85658db6caa9f347bc79afbd5c4090910a3d (diff)
Eliminate inappropriate use of FindProgramByName() from lli
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199835 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/lli')
-rw-r--r--tools/lli/lli.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp
index 2ee79793012..e6d4087476f 100644
--- a/tools/lli/lli.cpp
+++ b/tools/lli/lli.cpp
@@ -94,12 +94,11 @@ namespace {
// execution. The child process will be executed and will communicate with
// lli via stdin/stdout pipes.
cl::opt<std::string>
- MCJITRemoteProcess("mcjit-remote-process",
- cl::desc("Specify the filename of the process to launch "
- "for remote MCJIT execution. If none is specified,"
- "\n\tremote execution will be simulated in-process."),
- cl::value_desc("filename"),
- cl::init(""));
+ ChildExecPath("mcjit-remote-process",
+ cl::desc("Specify the filename of the process to launch "
+ "for remote MCJIT execution. If none is specified,"
+ "\n\tremote execution will be simulated in-process."),
+ cl::value_desc("filename"), cl::init(""));
// Determine optimization level.
cl::opt<char>
@@ -663,18 +662,17 @@ int main(int argc, char **argv, char * const *envp) {
// and send it to the target.
OwningPtr<RemoteTarget> Target;
- if (!MCJITRemoteProcess.empty()) { // Remote execution on a child process
+ if (!ChildExecPath.empty()) { // Remote execution on a child process
if (!RemoteTarget::hostSupportsExternalRemoteTarget()) {
errs() << "Warning: host does not support external remote targets.\n"
<< " Defaulting to simulated remote execution\n";
Target.reset(RemoteTarget::createRemoteTarget());
} else {
- std::string ChildEXE = sys::FindProgramByName(MCJITRemoteProcess);
- if (ChildEXE == "") {
- errs() << "Unable to find child target: '\''" << MCJITRemoteProcess << "\'\n";
+ if (!sys::fs::exists(ChildExecPath)) {
+ errs() << "Unable to find child target: '" << ChildExecPath << "'\n";
return -1;
}
- Target.reset(RemoteTarget::createExternalRemoteTarget(ChildEXE));
+ Target.reset(RemoteTarget::createExternalRemoteTarget(ChildExecPath));
}
} else {
// No child process name provided, use simulated remote execution.