diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-07-30 14:19:00 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-07-30 14:19:00 +0000 |
commit | 10757dd8e1a66128b205bd04797c8aed0cb7a1bd (patch) | |
tree | f07d3d4fc86cda011515761bdeabcf5be08037fe /tools/bugpoint/ExecutionDriver.cpp | |
parent | e099eba206f95eb690c64dced1e2555950a84df6 (diff) | |
download | external_llvm-10757dd8e1a66128b205bd04797c8aed0cb7a1bd.zip external_llvm-10757dd8e1a66128b205bd04797c8aed0cb7a1bd.tar.gz external_llvm-10757dd8e1a66128b205bd04797c8aed0cb7a1bd.tar.bz2 |
Add a Program argument to diffProgram to avoid a use of swapProgramIn.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109859 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r-- | tools/bugpoint/ExecutionDriver.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index 57f12d5..01dd379 100644 --- a/tools/bugpoint/ExecutionDriver.cpp +++ b/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; |