diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-18 15:29:32 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-06-18 15:29:32 +0000 |
commit | 302c0da6f138d1475b497a6e987787e94f15046f (patch) | |
tree | c939a1cd97e46053778d033cd933a94dc6572da1 /llvm/tools/bugpoint/OptimizerDriver.cpp | |
parent | 5d0708893d5c8c137687e79e184e5c794b60e55c (diff) | |
download | bcm5719-llvm-302c0da6f138d1475b497a6e987787e94f15046f.tar.gz bcm5719-llvm-302c0da6f138d1475b497a6e987787e94f15046f.zip |
Don't use PathV1.h in tools/bugpoint/Miscompilation.cpp.
llvm-svn: 184193
Diffstat (limited to 'llvm/tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r-- | llvm/tools/bugpoint/OptimizerDriver.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp index ffa108b522f..6cc8f1189e9 100644 --- a/llvm/tools/bugpoint/OptimizerDriver.cpp +++ b/llvm/tools/bugpoint/OptimizerDriver.cpp @@ -49,20 +49,28 @@ namespace { /// writeProgramToFile - This writes the current "Program" to the named bitcode /// file. If an error occurs, true is returned. /// +static bool writeProgramToFileAux(tool_output_file &Out, const Module *M) { + WriteBitcodeToFile(M, Out.os()); + Out.os().close(); + if (!Out.os().has_error()) { + Out.keep(); + return false; + } + return true; +} + +bool BugDriver::writeProgramToFile(const std::string &Filename, int FD, + const Module *M) const { + tool_output_file Out(Filename.c_str(), FD); + return writeProgramToFileAux(Out, M); +} + bool BugDriver::writeProgramToFile(const std::string &Filename, const Module *M) const { std::string ErrInfo; - tool_output_file Out(Filename.c_str(), ErrInfo, - raw_fd_ostream::F_Binary); - if (ErrInfo.empty()) { - WriteBitcodeToFile(M, Out.os()); - Out.os().close(); - if (!Out.os().has_error()) { - Out.keep(); - return false; - } - } - Out.os().clear_error(); + tool_output_file Out(Filename.c_str(), ErrInfo, raw_fd_ostream::F_Binary); + if (ErrInfo.empty()) + return writeProgramToFileAux(Out, M); return true; } |