summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint/ExecutionDriver.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-07-30 14:19:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-07-30 14:19:00 +0000
commitc89b1ef0a98f4a024fa61b7e6e62bad592f21ab5 (patch)
tree7c14ce1497705c5deccd39d1b007103cb4f52ebb /llvm/tools/bugpoint/ExecutionDriver.cpp
parentf9d5fe7fbd8e26955683ab602de331acaea7e232 (diff)
downloadbcm5719-llvm-c89b1ef0a98f4a024fa61b7e6e62bad592f21ab5.tar.gz
bcm5719-llvm-c89b1ef0a98f4a024fa61b7e6e62bad592f21ab5.zip
Add a Program argument to diffProgram to avoid a use of swapProgramIn.
llvm-svn: 109859
Diffstat (limited to 'llvm/tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r--llvm/tools/bugpoint/ExecutionDriver.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/llvm/tools/bugpoint/ExecutionDriver.cpp b/llvm/tools/bugpoint/ExecutionDriver.cpp
index 57f12d5af82..01dd379f41b 100644
--- a/llvm/tools/bugpoint/ExecutionDriver.cpp
+++ b/llvm/tools/bugpoint/ExecutionDriver.cpp
@@ -320,7 +320,8 @@ void BugDriver::compileProgram(Module *M, std::string *Error) {
/// program to a file, returning the filename of the file. A recommended
/// filename may be optionally specified.
///
-std::string BugDriver::executeProgram(std::string OutputFile,
+std::string BugDriver::executeProgram(const Module *Program,
+ std::string OutputFile,
std::string BitcodeFile,
const std::string &SharedObj,
AbstractInterpreter *AI,
@@ -399,9 +400,10 @@ std::string BugDriver::executeProgram(std::string OutputFile,
/// executeProgramSafely - Used to create reference output with the "safe"
/// backend, if reference output is not provided.
///
-std::string BugDriver::executeProgramSafely(std::string OutputFile,
+std::string BugDriver::executeProgramSafely(const Module *Program,
+ std::string OutputFile,
std::string *Error) {
- return executeProgram(OutputFile, "", "", SafeInterpreter, Error);
+ return executeProgram(Program, OutputFile, "", "", SafeInterpreter, Error);
}
std::string BugDriver::compileSharedObject(const std::string &BitcodeFile,
@@ -440,7 +442,7 @@ bool BugDriver::createReferenceFile(Module *M, const std::string &Filename) {
if (!Error.empty())
return false;
- ReferenceOutputFile = executeProgramSafely(Filename, &Error);
+ ReferenceOutputFile = executeProgramSafely(Program, Filename, &Error);
if (!Error.empty()) {
errs() << Error;
if (Interpreter != SafeInterpreter) {
@@ -460,12 +462,14 @@ bool BugDriver::createReferenceFile(Module *M, const std::string &Filename) {
/// is different, 1 is returned. If there is a problem with the code
/// generator (e.g., llc crashes), this will return -1 and set Error.
///
-bool BugDriver::diffProgram(const std::string &BitcodeFile,
+bool BugDriver::diffProgram(const Module *Program,
+ const std::string &BitcodeFile,
const std::string &SharedObject,
bool RemoveBitcode,
std::string *ErrMsg) {
// Execute the program, generating an output file...
- sys::Path Output(executeProgram("", BitcodeFile, SharedObject, 0, ErrMsg));
+ sys::Path Output(executeProgram(Program, "", BitcodeFile, SharedObject, 0,
+ ErrMsg));
if (!ErrMsg->empty())
return false;
OpenPOWER on IntegriCloud