mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
Added bugpoint options: -compile-custom and -compile-command=...
I've been using this mode to narrow down llc unit tests. Example custom compile script: llc "$@" not pygrep.py 'mul\s+r([0-9]), r\1,' < bugpoint-test-program.s git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125096 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -28,7 +28,8 @@ namespace {
|
||||
// for miscompilation.
|
||||
//
|
||||
enum OutputType {
|
||||
AutoPick, RunLLI, RunJIT, RunLLC, RunLLCIA, RunCBE, CBE_bug, LLC_Safe,Custom
|
||||
AutoPick, RunLLI, RunJIT, RunLLC, RunLLCIA, RunCBE, CBE_bug, LLC_Safe,
|
||||
CompileCustom, Custom
|
||||
};
|
||||
|
||||
cl::opt<double>
|
||||
@@ -50,6 +51,9 @@ namespace {
|
||||
clEnumValN(RunCBE, "run-cbe", "Compile with CBE"),
|
||||
clEnumValN(CBE_bug,"cbe-bug", "Find CBE bugs"),
|
||||
clEnumValN(LLC_Safe, "llc-safe", "Use LLC for all"),
|
||||
clEnumValN(CompileCustom, "compile-custom",
|
||||
"Use -compile-command to define a command to "
|
||||
"compile the bitcode. Useful to avoid linking."),
|
||||
clEnumValN(Custom, "run-custom",
|
||||
"Use -exec-command to define a command to execute "
|
||||
"the bitcode. Useful for cross-compilation."),
|
||||
@@ -90,6 +94,11 @@ namespace {
|
||||
AdditionalLinkerArgs("Xlinker",
|
||||
cl::desc("Additional arguments to pass to the linker"));
|
||||
|
||||
cl::opt<std::string>
|
||||
CustomCompileCommand("compile-command", cl::init("llc"),
|
||||
cl::desc("Command to compile the bitcode (use with -compile-custom) "
|
||||
"(default: llc)"));
|
||||
|
||||
cl::opt<std::string>
|
||||
CustomExecCommand("exec-command", cl::init("simulate"),
|
||||
cl::desc("Command to execute the bitcode (use with -run-custom) "
|
||||
@@ -192,8 +201,13 @@ bool BugDriver::initializeExecutionEnvironment() {
|
||||
GCCBinary, &ToolArgv,
|
||||
&GCCToolArgv);
|
||||
break;
|
||||
case CompileCustom:
|
||||
Interpreter =
|
||||
AbstractInterpreter::createCustomCompiler(Message, CustomCompileCommand);
|
||||
break;
|
||||
case Custom:
|
||||
Interpreter = AbstractInterpreter::createCustom(Message, CustomExecCommand);
|
||||
Interpreter =
|
||||
AbstractInterpreter::createCustomExecutor(Message, CustomExecCommand);
|
||||
break;
|
||||
default:
|
||||
Message = "Sorry, this back-end is not supported by bugpoint right now!\n";
|
||||
@@ -272,8 +286,8 @@ bool BugDriver::initializeExecutionEnvironment() {
|
||||
&GCCToolArgv);
|
||||
break;
|
||||
case Custom:
|
||||
SafeInterpreter = AbstractInterpreter::createCustom(Message,
|
||||
CustomExecCommand);
|
||||
SafeInterpreter =
|
||||
AbstractInterpreter::createCustomExecutor(Message, CustomExecCommand);
|
||||
break;
|
||||
default:
|
||||
Message = "Sorry, this back-end is not supported by bugpoint as the "
|
||||
|
Reference in New Issue
Block a user