summaryrefslogtreecommitdiff
path: root/tools/bugpoint/ExecutionDriver.cpp
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-02-08 18:20:48 +0000
committerAndrew Trick <atrick@apple.com>2011-02-08 18:20:48 +0000
commitf73311bb646bf970806ba7caba220e6bffff7b49 (patch)
tree5669f44799f681a2dbe1d20f66b8845e38800c9a /tools/bugpoint/ExecutionDriver.cpp
parentde86cbdc57f30621d3692da7a36613bb623d13b5 (diff)
downloadllvm-f73311bb646bf970806ba7caba220e6bffff7b49.tar.gz
llvm-f73311bb646bf970806ba7caba220e6bffff7b49.tar.bz2
llvm-f73311bb646bf970806ba7caba220e6bffff7b49.tar.xz
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
Diffstat (limited to 'tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r--tools/bugpoint/ExecutionDriver.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp
index 103002d915..f1601cdb84 100644
--- a/tools/bugpoint/ExecutionDriver.cpp
+++ b/tools/bugpoint/ExecutionDriver.cpp
@@ -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."),
@@ -91,6 +95,11 @@ namespace {
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) "
"(default: simulate)"));
@@ -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 "