diff options
author | Alp Toker <alp@nuanti.com> | 2014-01-22 21:52:35 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-01-22 21:52:35 +0000 |
commit | 1214e71d771ca1083b5cb7d12e515d10b6537db2 (patch) | |
tree | 0cb4f992a2cf4ee64867ca01d4224bc63d9d4429 /tools/lli | |
parent | 4bcb85658db6caa9f347bc79afbd5c4090910a3d (diff) | |
download | llvm-1214e71d771ca1083b5cb7d12e515d10b6537db2.tar.gz llvm-1214e71d771ca1083b5cb7d12e515d10b6537db2.tar.bz2 llvm-1214e71d771ca1083b5cb7d12e515d10b6537db2.tar.xz |
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.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/tools/lli/lli.cpp b/tools/lli/lli.cpp index 2ee7979301..e6d4087476 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. |