diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-09-09 06:11:26 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-09-09 06:11:26 +0000 |
commit | 70f684fcf92e5cdd11a3b3fc9bf3519f8b745857 (patch) | |
tree | 983a3db29dd68e04324f1f6bcc44419b8b884947 /tools/bugpoint | |
parent | cf01f7a78c18224866595b4b493d03a3de305e1f (diff) | |
download | external_llvm-70f684fcf92e5cdd11a3b3fc9bf3519f8b745857.zip external_llvm-70f684fcf92e5cdd11a3b3fc9bf3519f8b745857.tar.gz external_llvm-70f684fcf92e5cdd11a3b3fc9bf3519f8b745857.tar.bz2 |
Allow use of ssh to perform remote execution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint')
-rw-r--r-- | tools/bugpoint/ToolRunner.cpp | 39 | ||||
-rw-r--r-- | tools/bugpoint/ToolRunner.h | 6 |
2 files changed, 28 insertions, 17 deletions
diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index d25ce6c..d4cea9f 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -25,12 +25,20 @@ using namespace llvm; namespace { cl::opt<std::string> - RSHHost("rsh-host", - cl::desc("Remote execution (rsh) host")); + RemoteClient("remote-client", + cl::desc("Remote execution client (rsh/ssh)")); cl::opt<std::string> - RSHUser("rsh-user", - cl::desc("Remote execution (rsh) user id")); + RemoteHost("remote-host", + cl::desc("Remote execution (rsh/ssh) host")); + + cl::opt<std::string> + RemoteUser("remote-user", + cl::desc("Remote execution (rsh/ssh) user id")); + + cl::opt<std::string> + RemoteExtra("remote-extra-options", + cl::desc("Remote execution (rsh/ssh) extra options")); } ToolExecutionError::~ToolExecutionError() throw() { } @@ -597,13 +605,16 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, std::vector<const char*> ProgramArgs; - if (RSHPath.isEmpty()) + if (RemoteClientPath.isEmpty()) ProgramArgs.push_back(OutputBinary.c_str()); else { - ProgramArgs.push_back(RSHPath.c_str()); - ProgramArgs.push_back(RSHHost.c_str()); + ProgramArgs.push_back(RemoteClientPath.c_str()); + ProgramArgs.push_back(RemoteHost.c_str()); ProgramArgs.push_back("-l"); - ProgramArgs.push_back(RSHUser.c_str()); + ProgramArgs.push_back(RemoteUser.c_str()); + if (!RemoteExtra.empty()) { + ProgramArgs.push_back(RemoteExtra.c_str()); + } char* env_pwd = getenv("PWD"); std::string Exec = "cd "; @@ -628,12 +639,12 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, FileRemover OutputBinaryRemover(OutputBinary); - if (RSHPath.isEmpty()) + if (RemoteClientPath.isEmpty()) return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), Timeout, MemoryLimit); else - return RunProgramWithTimeout(sys::Path(RSHPath), &ProgramArgs[0], + return RunProgramWithTimeout(sys::Path(RemoteClientPath), &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), Timeout, MemoryLimit); } @@ -721,10 +732,10 @@ GCC *GCC::create(const std::string &ProgramPath, std::string &Message) { return 0; } - sys::Path RSHPath; - if (!RSHHost.empty()) - RSHPath = FindExecutable("rsh", ProgramPath); + sys::Path RemoteClientPath; + if (!RemoteClient.empty()) + RemoteClientPath = FindExecutable(RemoteClient.c_str(), ProgramPath); Message = "Found gcc: " + GCCPath.toString() + "\n"; - return new GCC(GCCPath, RSHPath); + return new GCC(GCCPath, RemoteClientPath); } diff --git a/tools/bugpoint/ToolRunner.h b/tools/bugpoint/ToolRunner.h index 0cc5426..c7ec1c5 100644 --- a/tools/bugpoint/ToolRunner.h +++ b/tools/bugpoint/ToolRunner.h @@ -44,9 +44,9 @@ public: // class GCC { sys::Path GCCPath; // The path to the gcc executable - sys::Path RSHPath; // The path to the rsh executable - GCC(const sys::Path &gccPath, const sys::Path &rshPath) - : GCCPath(gccPath), RSHPath(rshPath) { } + sys::Path RemoteClientPath; // The path to the rsh / ssh executable + GCC(const sys::Path &gccPath, const sys::Path &RemotePath) + : GCCPath(gccPath), RemoteClientPath(RemotePath) { } public: enum FileType { AsmFile, CFile }; |