mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-01 13:37:55 +00:00
Support remote execute for ARM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75292 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
19a2011194
commit
80becf194d
@ -205,7 +205,7 @@ bool BugDriver::run() {
|
|||||||
std::cout << "*** Checking the code generator...\n";
|
std::cout << "*** Checking the code generator...\n";
|
||||||
try {
|
try {
|
||||||
if (!diffProgram()) {
|
if (!diffProgram()) {
|
||||||
std::cout << "\n*** Debugging miscompilation!\n";
|
std::cout << "\n*** Output matches: Debugging miscompilation!\n";
|
||||||
return debugMiscompilation();
|
return debugMiscompilation();
|
||||||
}
|
}
|
||||||
} catch (ToolExecutionError &TEE) {
|
} catch (ToolExecutionError &TEE) {
|
||||||
|
@ -457,9 +457,10 @@ bool BugDriver::diffProgram(const std::string &BitcodeFile,
|
|||||||
}
|
}
|
||||||
FilesDifferent = true;
|
FilesDifferent = true;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
// Remove the generated output.
|
// Remove the generated output if there are no differences.
|
||||||
Output.eraseFromDisk();
|
Output.eraseFromDisk();
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the bitcode file if we are supposed to.
|
// Remove the bitcode file if we are supposed to.
|
||||||
if (RemoveBitcode)
|
if (RemoveBitcode)
|
||||||
|
@ -57,7 +57,7 @@ ReduceMiscompilingPasses::doTest(std::vector<const PassInfo*> &Prefix,
|
|||||||
// First, run the program with just the Suffix passes. If it is still broken
|
// First, run the program with just the Suffix passes. If it is still broken
|
||||||
// with JUST the kept passes, discard the prefix passes.
|
// with JUST the kept passes, discard the prefix passes.
|
||||||
std::cout << "Checking to see if '" << getPassesString(Suffix)
|
std::cout << "Checking to see if '" << getPassesString(Suffix)
|
||||||
<< "' compile correctly: ";
|
<< "' compiles correctly: ";
|
||||||
|
|
||||||
std::string BitcodeResult;
|
std::string BitcodeResult;
|
||||||
if (BD.runPasses(Suffix, BitcodeResult, false/*delete*/, true/*quiet*/)) {
|
if (BD.runPasses(Suffix, BitcodeResult, false/*delete*/, true/*quiet*/)) {
|
||||||
@ -85,7 +85,7 @@ ReduceMiscompilingPasses::doTest(std::vector<const PassInfo*> &Prefix,
|
|||||||
// Next, see if the program is broken if we run the "prefix" passes first,
|
// Next, see if the program is broken if we run the "prefix" passes first,
|
||||||
// then separately run the "kept" passes.
|
// then separately run the "kept" passes.
|
||||||
std::cout << "Checking to see if '" << getPassesString(Prefix)
|
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
|
// 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
|
// passes must be run before the kept passes to break it. If the program
|
||||||
|
@ -32,6 +32,10 @@ namespace {
|
|||||||
RemoteHost("remote-host",
|
RemoteHost("remote-host",
|
||||||
cl::desc("Remote execution (rsh/ssh) host"));
|
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>
|
cl::opt<std::string>
|
||||||
RemoteUser("remote-user",
|
RemoteUser("remote-user",
|
||||||
cl::desc("Remote execution (rsh/ssh) user id"));
|
cl::desc("Remote execution (rsh/ssh) user id"));
|
||||||
@ -538,6 +542,23 @@ CBE *AbstractInterpreter::createCBE(const std::string &ProgramPath,
|
|||||||
//===---------------------------------------------------------------------===//
|
//===---------------------------------------------------------------------===//
|
||||||
// GCC abstraction
|
// 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,
|
int GCC::ExecuteProgram(const std::string &ProgramFile,
|
||||||
const std::vector<std::string> &Args,
|
const std::vector<std::string> &Args,
|
||||||
FileType fileType,
|
FileType fileType,
|
||||||
@ -562,6 +583,10 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
|
|||||||
} else {
|
} else {
|
||||||
GCCArgs.push_back("assembler");
|
GCCArgs.push_back("assembler");
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
// 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");
|
GCCArgs.push_back("-force_cpusubtype_ALL");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -615,6 +640,10 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
|
|||||||
ProgramArgs.push_back(RemoteHost.c_str());
|
ProgramArgs.push_back(RemoteHost.c_str());
|
||||||
ProgramArgs.push_back("-l");
|
ProgramArgs.push_back("-l");
|
||||||
ProgramArgs.push_back(RemoteUser.c_str());
|
ProgramArgs.push_back(RemoteUser.c_str());
|
||||||
|
if (!RemotePort.empty()) {
|
||||||
|
ProgramArgs.push_back("-p");
|
||||||
|
ProgramArgs.push_back(RemotePort.c_str());
|
||||||
|
}
|
||||||
if (!RemoteExtra.empty()) {
|
if (!RemoteExtra.empty()) {
|
||||||
ProgramArgs.push_back(RemoteExtra.c_str());
|
ProgramArgs.push_back(RemoteExtra.c_str());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user