diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2010-07-28 18:12:30 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2010-07-28 18:12:30 +0000 |
commit | 594994a34c5faaadd8b6d0f1e4f06e922857f652 (patch) | |
tree | 141913a43dd1adebd2435f0934d097cb3a4e6850 /llvm/tools/bugpoint/OptimizerDriver.cpp | |
parent | 564798dfa94c7f33b3f5e8ae4a37b95c7e20e8d0 (diff) | |
download | bcm5719-llvm-594994a34c5faaadd8b6d0f1e4f06e922857f652.tar.gz bcm5719-llvm-594994a34c5faaadd8b6d0f1e4f06e922857f652.zip |
Instead of abusing swapProgramIn, just add a Module argument to
EmitProgressBitcode.
llvm-svn: 109602
Diffstat (limited to 'llvm/tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r-- | llvm/tools/bugpoint/OptimizerDriver.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp index 3a6149b24a5..48936caf5fd 100644 --- a/llvm/tools/bugpoint/OptimizerDriver.cpp +++ b/llvm/tools/bugpoint/OptimizerDriver.cpp @@ -51,13 +51,13 @@ namespace { /// file. If an error occurs, true is returned. /// bool BugDriver::writeProgramToFile(const std::string &Filename, - Module *M) const { + const Module *M) const { std::string ErrInfo; raw_fd_ostream Out(Filename.c_str(), ErrInfo, raw_fd_ostream::F_Binary); if (!ErrInfo.empty()) return true; - WriteBitcodeToFile(M ? M : Program, Out); + WriteBitcodeToFile(M, Out); return false; } @@ -65,12 +65,13 @@ bool BugDriver::writeProgramToFile(const std::string &Filename, /// EmitProgressBitcode - This function is used to output the current Program /// to a file named "bugpoint-ID.bc". /// -void BugDriver::EmitProgressBitcode(const std::string &ID, bool NoFlyer) { +void BugDriver::EmitProgressBitcode(const Module *M, + const std::string &ID, bool NoFlyer) { // Output the input to the current pass to a bitcode file, emit a message // telling the user how to reproduce it: opt -foo blah.bc // std::string Filename = OutputPrefix + "-" + ID + ".bc"; - if (writeProgramToFile(Filename)) { + if (writeProgramToFile(Filename, M)) { errs() << "Error opening file '" << Filename << "' for writing!\n"; return; } @@ -246,7 +247,7 @@ Module *BugDriver::runPassesOn(Module *M, errs() << " Error running this sequence of passes" << " on the input program!\n"; delete OldProgram; - EmitProgressBitcode("pass-error", false); + EmitProgressBitcode(Program, "pass-error", false); exit(debugOptimizerCrash()); } swapProgramIn(OldProgram); |