[llvm-commits] [llvm] r75292 - in /llvm/trunk/tools/bugpoint: BugDriver.cpp ExecutionDriver.cpp Miscompilation.cpp ToolRunner.cpp
David Goodwin
david_goodwin at apple.com
Fri Jul 10 14:39:29 PDT 2009
Author: david_goodwin
Date: Fri Jul 10 16:39:28 2009
New Revision: 75292
URL: http://llvm.org/viewvc/llvm-project?rev=75292&view=rev
Log:
Support remote execute for ARM.
Modified:
llvm/trunk/tools/bugpoint/BugDriver.cpp
llvm/trunk/tools/bugpoint/ExecutionDriver.cpp
llvm/trunk/tools/bugpoint/Miscompilation.cpp
llvm/trunk/tools/bugpoint/ToolRunner.cpp
Modified: llvm/trunk/tools/bugpoint/BugDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/BugDriver.cpp?rev=75292&r1=75291&r2=75292&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/BugDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/BugDriver.cpp Fri Jul 10 16:39:28 2009
@@ -205,7 +205,7 @@
std::cout << "*** Checking the code generator...\n";
try {
if (!diffProgram()) {
- std::cout << "\n*** Debugging miscompilation!\n";
+ std::cout << "\n*** Output matches: Debugging miscompilation!\n";
return debugMiscompilation();
}
} catch (ToolExecutionError &TEE) {
Modified: llvm/trunk/tools/bugpoint/ExecutionDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExecutionDriver.cpp?rev=75292&r1=75291&r2=75292&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ExecutionDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/ExecutionDriver.cpp Fri Jul 10 16:39:28 2009
@@ -457,9 +457,10 @@
}
FilesDifferent = true;
}
-
- // Remove the generated output.
- Output.eraseFromDisk();
+ else {
+ // Remove the generated output if there are no differences.
+ Output.eraseFromDisk();
+ }
// Remove the bitcode file if we are supposed to.
if (RemoveBitcode)
Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=75292&r1=75291&r2=75292&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original)
+++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Fri Jul 10 16:39:28 2009
@@ -57,7 +57,7 @@
// First, run the program with just the Suffix passes. If it is still broken
// with JUST the kept passes, discard the prefix passes.
std::cout << "Checking to see if '" << getPassesString(Suffix)
- << "' compile correctly: ";
+ << "' compiles correctly: ";
std::string BitcodeResult;
if (BD.runPasses(Suffix, BitcodeResult, false/*delete*/, true/*quiet*/)) {
@@ -85,7 +85,7 @@
// Next, see if the program is broken if we run the "prefix" passes first,
// then separately run the "kept" passes.
std::cout << "Checking to see if '" << getPassesString(Prefix)
- << "' compile correctly: ";
+ << "' compiles correctly: ";
// If it is not broken with the kept passes, it's possible that the prefix
// passes must be run before the kept passes to break it. If the program
Modified: llvm/trunk/tools/bugpoint/ToolRunner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ToolRunner.cpp?rev=75292&r1=75291&r2=75292&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ToolRunner.cpp (original)
+++ llvm/trunk/tools/bugpoint/ToolRunner.cpp Fri Jul 10 16:39:28 2009
@@ -33,6 +33,10 @@
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 @@
//===---------------------------------------------------------------------===//
// 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 @@
} 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 @@
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());
}
More information about the llvm-commits
mailing list