diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-06-06 00:00:42 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-06-06 00:00:42 +0000 |
commit | 51ab5c8862466bbddcd5c4369779c472978ed309 (patch) | |
tree | e036df19b84beccf4f3951f60d6a22bd5bb1c378 /tools/bugpoint/ExecutionDriver.cpp | |
parent | 4b02367d542c7eaa429d1ff73119ae44ddb252a8 (diff) | |
download | external_llvm-51ab5c8862466bbddcd5c4369779c472978ed309.zip external_llvm-51ab5c8862466bbddcd5c4369779c472978ed309.tar.gz external_llvm-51ab5c8862466bbddcd5c4369779c472978ed309.tar.bz2 |
Add the -Xlinker option to bugpoint which allows an option to be passed
through to gcc when its being used as a linker. This allows -L and -l
(and any other) options to be added so that non-complete bytecode files
can be processed with bugpoint. The -Xlinker option can be added as many
times as needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28692 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r-- | tools/bugpoint/ExecutionDriver.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index 79a8ef8..481d1d1 100644 --- a/tools/bugpoint/ExecutionDriver.cpp +++ b/tools/bugpoint/ExecutionDriver.cpp @@ -20,6 +20,7 @@ #include "llvm/Support/SystemUtils.h" #include <fstream> #include <iostream> + using namespace llvm; namespace { @@ -66,6 +67,10 @@ namespace { TimeoutValue("timeout", cl::init(300), cl::value_desc("seconds"), cl::desc("Number of seconds program is allowed to run before it " "is killed (default is 300s), 0 disables timeout")); + + cl::list<std::string> + AdditionalLinkerArgs("Xlinker", + cl::desc("Additional arguments to pass to the linker")); } namespace llvm { @@ -218,9 +223,19 @@ std::string BugDriver::executeProgram(std::string OutputFile, if (!SharedObj.empty()) SharedObjs.push_back(SharedObj); - // Actually execute the program! - int RetVal = AI->ExecuteProgram(BytecodeFile, InputArgv, InputFile, - OutputFile, SharedObjs, TimeoutValue); + + // If this is an LLC or CBE run, then the GCC compiler might get run to + // compile the program. If so, we should pass the user's -Xlinker options + // as the GCCArgs. + int RetVal = 0; + if (InterpreterSel == RunLLC || InterpreterSel == RunCBE) + RetVal = AI->ExecuteProgram(BytecodeFile, InputArgv, InputFile, + OutputFile, AdditionalLinkerArgs, SharedObjs, + TimeoutValue); + else + RetVal = AI->ExecuteProgram(BytecodeFile, InputArgv, InputFile, + OutputFile, std::vector<std::string>(), + SharedObjs, TimeoutValue); if (RetVal == -1) { std::cerr << "<timeout>"; |