summaryrefslogtreecommitdiff
path: root/tools/bugpoint/ToolRunner.cpp
diff options
context:
space:
mode:
authorDavid Goodwin <david_goodwin@apple.com>2009-07-10 21:39:28 +0000
committerDavid Goodwin <david_goodwin@apple.com>2009-07-10 21:39:28 +0000
commit80becf194d56524e8c75618ac57a34520f87a684 (patch)
treea4a2cbeb546cd20cc9e564fdd50310bd99b29f6d /tools/bugpoint/ToolRunner.cpp
parent19a2011194399849ecdf1499c7615e8276a8e68c (diff)
downloadllvm-80becf194d56524e8c75618ac57a34520f87a684.tar.gz
llvm-80becf194d56524e8c75618ac57a34520f87a684.tar.bz2
llvm-80becf194d56524e8c75618ac57a34520f87a684.tar.xz
Support remote execute for ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ToolRunner.cpp')
-rw-r--r--tools/bugpoint/ToolRunner.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp
index 978e60bed3..7087cdd3d1 100644
--- a/tools/bugpoint/ToolRunner.cpp
+++ b/tools/bugpoint/ToolRunner.cpp
@@ -33,6 +33,10 @@ namespace {
cl::desc("Remote execution (rsh/ssh) host"));
cl::opt<std::string>
+ RemotePort("remote-port",
+ cl::desc("Remote execution (rsh/ssh) port"));
+
+ cl::opt<std::string>
RemoteUser("remote-user",
cl::desc("Remote execution (rsh/ssh) user id"));
@@ -538,6 +542,23 @@ CBE *AbstractInterpreter::createCBE(const std::string &ProgramPath,
//===---------------------------------------------------------------------===//
// GCC abstraction
//
+
+static bool
+IsARMArchitecture(std::vector<std::string> Args)
+{
+ for (std::vector<std::string>::const_iterator
+ I = Args.begin(), E = Args.end(); I != E; ++I) {
+ if (!strcasecmp(I->c_str(), "-arch")) {
+ ++I;
+ if ((I != E) && !strncasecmp(I->c_str(), "arm", strlen("arm"))) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
int GCC::ExecuteProgram(const std::string &ProgramFile,
const std::vector<std::string> &Args,
FileType fileType,
@@ -562,7 +583,11 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
} else {
GCCArgs.push_back("assembler");
#ifdef __APPLE__
- GCCArgs.push_back("-force_cpusubtype_ALL");
+ // For ARM architectures we don't want this flag. bugpoint isn't
+ // explicitly told what architecture it is working on, so we get
+ // it from gcc flags
+ if (!IsARMArchitecture(ArgsForGCC))
+ GCCArgs.push_back("-force_cpusubtype_ALL");
#endif
}
GCCArgs.push_back(ProgramFile.c_str()); // Specify the input filename...
@@ -615,6 +640,10 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
ProgramArgs.push_back(RemoteHost.c_str());
ProgramArgs.push_back("-l");
ProgramArgs.push_back(RemoteUser.c_str());
+ if (!RemotePort.empty()) {
+ ProgramArgs.push_back("-p");
+ ProgramArgs.push_back(RemotePort.c_str());
+ }
if (!RemoteExtra.empty()) {
ProgramArgs.push_back(RemoteExtra.c_str());
}