Permalink
Browse files

Add --tool-args flag which lets you pass arguments to llc or lli.

This is intended to address Bug 40.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13358 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information...
1 parent 7e43753 commit 636df3d7ec51a8c6fd759a98853ff709ae54d64e Brian Gaeke committed May 4, 2004
Showing with 22 additions and 9 deletions.
  1. +22 −9 tools/bugpoint/ExecutionDriver.cpp
@@ -71,6 +71,10 @@ namespace llvm {
cl::list<std::string>
InputArgv("args", cl::Positional, cl::desc("<program arguments>..."),
cl::ZeroOrMore);
+
+ cl::list<std::string>
+ ToolArgv("tool-args", cl::Positional, cl::desc("<tool arguments>..."),
+ cl::ZeroOrMore);
}
//===----------------------------------------------------------------------===//
@@ -87,38 +91,47 @@ bool BugDriver::initializeExecutionEnvironment() {
// the command line
cbe = 0;
std::string Message;
+
switch (InterpreterSel) {
case AutoPick:
InterpreterSel = RunCBE;
- Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message);
+ Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message,
+ &ToolArgv);
if (!Interpreter) {
InterpreterSel = RunJIT;
- Interpreter = AbstractInterpreter::createJIT(getToolName(), Message);
+ Interpreter = AbstractInterpreter::createJIT(getToolName(), Message,
+ &ToolArgv);
}
if (!Interpreter) {
InterpreterSel = RunLLC;
- Interpreter = AbstractInterpreter::createLLC(getToolName(), Message);
+ Interpreter = AbstractInterpreter::createLLC(getToolName(), Message,
+ &ToolArgv);
}
if (!Interpreter) {
InterpreterSel = RunLLI;
- Interpreter = AbstractInterpreter::createLLI(getToolName(), Message);
+ Interpreter = AbstractInterpreter::createLLI(getToolName(), Message,
+ &ToolArgv);
}
if (!Interpreter) {
InterpreterSel = AutoPick;
Message = "Sorry, I can't automatically select an interpreter!\n";
}
break;
case RunLLI:
- Interpreter = AbstractInterpreter::createLLI(getToolName(), Message);
+ Interpreter = AbstractInterpreter::createLLI(getToolName(), Message,
+ &ToolArgv);
break;
case RunLLC:
- Interpreter = AbstractInterpreter::createLLC(getToolName(), Message);
+ Interpreter = AbstractInterpreter::createLLC(getToolName(), Message,
+ &ToolArgv);
break;
case RunJIT:
- Interpreter = AbstractInterpreter::createJIT(getToolName(), Message);
+ Interpreter = AbstractInterpreter::createJIT(getToolName(), Message,
+ &ToolArgv);
break;
case RunCBE:
- Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message);
+ Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message,
+ &ToolArgv);
break;
default:
Message = "Sorry, this back-end is not supported by bugpoint right now!\n";
@@ -128,7 +141,7 @@ bool BugDriver::initializeExecutionEnvironment() {
// Initialize auxiliary tools for debugging
if (!cbe) {
- cbe = AbstractInterpreter::createCBE(getToolName(), Message);
+ cbe = AbstractInterpreter::createCBE(getToolName(), Message, &ToolArgv);
if (!cbe) { std::cout << Message << "\nExiting.\n"; exit(1); }
}
gcc = GCC::create(getToolName(), Message);

0 comments on commit 636df3d

Please sign in to comment.