1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

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

This is intended to address Bug 40.

llvm-svn: 13358
This commit is contained in:
Brian Gaeke 2004-05-04 21:09:16 +00:00
parent 28d81c4d0d
commit 433b49b796

View File

@ -71,6 +71,10 @@ namespace llvm {
cl::list<std::string> cl::list<std::string>
InputArgv("args", cl::Positional, cl::desc("<program arguments>..."), InputArgv("args", cl::Positional, cl::desc("<program arguments>..."),
cl::ZeroOrMore); cl::ZeroOrMore);
cl::list<std::string>
ToolArgv("tool-args", cl::Positional, cl::desc("<tool arguments>..."),
cl::ZeroOrMore);
} }
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@ -87,21 +91,26 @@ bool BugDriver::initializeExecutionEnvironment() {
// the command line // the command line
cbe = 0; cbe = 0;
std::string Message; std::string Message;
switch (InterpreterSel) { switch (InterpreterSel) {
case AutoPick: case AutoPick:
InterpreterSel = RunCBE; InterpreterSel = RunCBE;
Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message); Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message,
&ToolArgv);
if (!Interpreter) { if (!Interpreter) {
InterpreterSel = RunJIT; InterpreterSel = RunJIT;
Interpreter = AbstractInterpreter::createJIT(getToolName(), Message); Interpreter = AbstractInterpreter::createJIT(getToolName(), Message,
&ToolArgv);
} }
if (!Interpreter) { if (!Interpreter) {
InterpreterSel = RunLLC; InterpreterSel = RunLLC;
Interpreter = AbstractInterpreter::createLLC(getToolName(), Message); Interpreter = AbstractInterpreter::createLLC(getToolName(), Message,
&ToolArgv);
} }
if (!Interpreter) { if (!Interpreter) {
InterpreterSel = RunLLI; InterpreterSel = RunLLI;
Interpreter = AbstractInterpreter::createLLI(getToolName(), Message); Interpreter = AbstractInterpreter::createLLI(getToolName(), Message,
&ToolArgv);
} }
if (!Interpreter) { if (!Interpreter) {
InterpreterSel = AutoPick; InterpreterSel = AutoPick;
@ -109,16 +118,20 @@ bool BugDriver::initializeExecutionEnvironment() {
} }
break; break;
case RunLLI: case RunLLI:
Interpreter = AbstractInterpreter::createLLI(getToolName(), Message); Interpreter = AbstractInterpreter::createLLI(getToolName(), Message,
&ToolArgv);
break; break;
case RunLLC: case RunLLC:
Interpreter = AbstractInterpreter::createLLC(getToolName(), Message); Interpreter = AbstractInterpreter::createLLC(getToolName(), Message,
&ToolArgv);
break; break;
case RunJIT: case RunJIT:
Interpreter = AbstractInterpreter::createJIT(getToolName(), Message); Interpreter = AbstractInterpreter::createJIT(getToolName(), Message,
&ToolArgv);
break; break;
case RunCBE: case RunCBE:
Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message); Interpreter = cbe = AbstractInterpreter::createCBE(getToolName(), Message,
&ToolArgv);
break; break;
default: default:
Message = "Sorry, this back-end is not supported by bugpoint right now!\n"; 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 // Initialize auxiliary tools for debugging
if (!cbe) { if (!cbe) {
cbe = AbstractInterpreter::createCBE(getToolName(), Message); cbe = AbstractInterpreter::createCBE(getToolName(), Message, &ToolArgv);
if (!cbe) { std::cout << Message << "\nExiting.\n"; exit(1); } if (!cbe) { std::cout << Message << "\nExiting.\n"; exit(1); }
} }
gcc = GCC::create(getToolName(), Message); gcc = GCC::create(getToolName(), Message);