From 636df3d7ec51a8c6fd759a98853ff709ae54d64e Mon Sep 17 00:00:00 2001 From: Brian Gaeke Date: Tue, 4 May 2004 21:09:16 +0000 Subject: [PATCH] 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 --- tools/bugpoint/ExecutionDriver.cpp | 31 +++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index 4d5c78368f7..73a923b5eb1 100644 --- a/tools/bugpoint/ExecutionDriver.cpp +++ b/tools/bugpoint/ExecutionDriver.cpp @@ -71,6 +71,10 @@ namespace llvm { cl::list InputArgv("args", cl::Positional, cl::desc("..."), cl::ZeroOrMore); + + cl::list + ToolArgv("tool-args", cl::Positional, cl::desc("..."), + cl::ZeroOrMore); } //===----------------------------------------------------------------------===// @@ -87,21 +91,26 @@ 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; @@ -109,16 +118,20 @@ bool BugDriver::initializeExecutionEnvironment() { } 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); -- 2.34.1