aboutsummaryrefslogtreecommitdiff
path: root/tools/bugpoint/ExecutionDriver.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-03-02 23:13:18 +0000
committerBill Wendling <isanbard@gmail.com>2009-03-02 23:13:18 +0000
commit38efa38c864f6d29892d92102c0232b234b526ed (patch)
treed121f75ee3af7dcfdceb4695f4a3c1e8ac445909 /tools/bugpoint/ExecutionDriver.cpp
parent0b82f77e662790ab3c230932f5309c5105812c26 (diff)
Add a "-gcc-tool-args" option. This option acts like the "-tool-args" option,
but passes the arguments to the "gcc" invocation instead of to the "llc" invocation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r--tools/bugpoint/ExecutionDriver.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp
index b3c802032d..640fe2829a 100644
--- a/tools/bugpoint/ExecutionDriver.cpp
+++ b/tools/bugpoint/ExecutionDriver.cpp
@@ -111,6 +111,11 @@ namespace {
SafeToolArgv("safe-tool-args", cl::Positional,
cl::desc("<safe-tool arguments>..."),
cl::ZeroOrMore, cl::PositionalEatsArgs);
+
+ cl::list<std::string>
+ GCCToolArgv("gcc-tool-args", cl::Positional,
+ cl::desc("<gcc-tool arguments>..."),
+ cl::ZeroOrMore, cl::PositionalEatsArgs);
}
//===----------------------------------------------------------------------===//
@@ -132,7 +137,8 @@ bool BugDriver::initializeExecutionEnvironment() {
case AutoPick:
InterpreterSel = RunCBE;
Interpreter =
- AbstractInterpreter::createCBE(getToolName(), Message, &ToolArgv);
+ AbstractInterpreter::createCBE(getToolName(), Message, &ToolArgv,
+ &GCCToolArgv);
if (!Interpreter) {
InterpreterSel = RunJIT;
Interpreter = AbstractInterpreter::createJIT(getToolName(), Message,
@@ -141,7 +147,7 @@ bool BugDriver::initializeExecutionEnvironment() {
if (!Interpreter) {
InterpreterSel = RunLLC;
Interpreter = AbstractInterpreter::createLLC(getToolName(), Message,
- &ToolArgv);
+ &ToolArgv, &GCCToolArgv);
}
if (!Interpreter) {
InterpreterSel = RunLLI;
@@ -160,7 +166,7 @@ bool BugDriver::initializeExecutionEnvironment() {
case RunLLC:
case LLC_Safe:
Interpreter = AbstractInterpreter::createLLC(getToolName(), Message,
- &ToolArgv);
+ &ToolArgv, &GCCToolArgv);
break;
case RunJIT:
Interpreter = AbstractInterpreter::createJIT(getToolName(), Message,
@@ -169,7 +175,7 @@ bool BugDriver::initializeExecutionEnvironment() {
case RunCBE:
case CBE_bug:
Interpreter = AbstractInterpreter::createCBE(getToolName(), Message,
- &ToolArgv);
+ &ToolArgv, &GCCToolArgv);
break;
case Custom:
Interpreter = AbstractInterpreter::createCustom(getToolName(), Message,
@@ -196,7 +202,8 @@ bool BugDriver::initializeExecutionEnvironment() {
SafeInterpreterSel = RunLLC;
SafeToolArgs.push_back("--relocation-model=pic");
SafeInterpreter = AbstractInterpreter::createLLC(Path, Message,
- &SafeToolArgs);
+ &SafeToolArgs,
+ &GCCToolArgv);
}
// In "llc-safe" mode, default to using LLC as the "safe" backend.
@@ -205,7 +212,8 @@ bool BugDriver::initializeExecutionEnvironment() {
SafeInterpreterSel = RunLLC;
SafeToolArgs.push_back("--relocation-model=pic");
SafeInterpreter = AbstractInterpreter::createLLC(Path, Message,
- &SafeToolArgs);
+ &SafeToolArgs,
+ &GCCToolArgv);
}
// Pick a backend that's different from the test backend. The JIT and
@@ -215,7 +223,8 @@ bool BugDriver::initializeExecutionEnvironment() {
InterpreterSel != RunCBE) {
SafeInterpreterSel = RunCBE;
SafeInterpreter = AbstractInterpreter::createCBE(Path, Message,
- &SafeToolArgs);
+ &SafeToolArgs,
+ &GCCToolArgv);
}
if (!SafeInterpreter &&
InterpreterSel != RunLLC &&
@@ -223,7 +232,8 @@ bool BugDriver::initializeExecutionEnvironment() {
SafeInterpreterSel = RunLLC;
SafeToolArgs.push_back("--relocation-model=pic");
SafeInterpreter = AbstractInterpreter::createLLC(Path, Message,
- &SafeToolArgs);
+ &SafeToolArgs,
+ &GCCToolArgv);
}
if (!SafeInterpreter) {
SafeInterpreterSel = AutoPick;
@@ -233,11 +243,13 @@ bool BugDriver::initializeExecutionEnvironment() {
case RunLLC:
SafeToolArgs.push_back("--relocation-model=pic");
SafeInterpreter = AbstractInterpreter::createLLC(Path, Message,
- &SafeToolArgs);
+ &SafeToolArgs,
+ &GCCToolArgv);
break;
case RunCBE:
SafeInterpreter = AbstractInterpreter::createCBE(Path, Message,
- &SafeToolArgs);
+ &SafeToolArgs,
+ &GCCToolArgv);
break;
case Custom:
SafeInterpreter = AbstractInterpreter::createCustom(Path, Message,
@@ -250,7 +262,7 @@ bool BugDriver::initializeExecutionEnvironment() {
}
if (!SafeInterpreter) { std::cout << Message << "\nExiting.\n"; exit(1); }
- gcc = GCC::create(getToolName(), Message);
+ gcc = GCC::create(getToolName(), Message, &GCCToolArgv);
if (!gcc) { std::cout << Message << "\nExiting.\n"; exit(1); }
// If there was an error creating the selected interpreter, quit with error.
@@ -406,7 +418,7 @@ bool BugDriver::createReferenceFile(Module *M, const std::string &Filename) {
}
try {
ReferenceOutputFile = executeProgramSafely(Filename);
- std::cout << "Reference output is: " << ReferenceOutputFile << "\n\n";
+ std::cout << "\nReference output is: " << ReferenceOutputFile << "\n\n";
} catch (ToolExecutionError &TEE) {
std::cerr << TEE.what();
if (Interpreter != SafeInterpreter) {