summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-05-27 20:19:47 +0000
committerDan Gohman <gohman@apple.com>2010-05-27 20:19:47 +0000
commitab366f055acc1f416d3dc8775aca97ed7f82ff2c (patch)
treec90528b81eca92719bdbcfb5f51a3e4881374b58
parent75593942705cd1b45262746061988a58fd108cd3 (diff)
downloadbcm5719-llvm-ab366f055acc1f416d3dc8775aca97ed7f82ff2c.tar.gz
bcm5719-llvm-ab366f055acc1f416d3dc8775aca97ed7f82ff2c.zip
When handling raw_ostream errors manually, use clear_error() so that
raw_ostream doesn't try to do its own error handling. Also, close the raw_ostream before checking for errors so that any errors that occur during closing are caught by the manual check. llvm-svn: 104882
-rw-r--r--llvm/tools/lto/LTOCodeGenerator.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/tools/lto/LTOCodeGenerator.cpp b/llvm/tools/lto/LTOCodeGenerator.cpp
index 59e8405e7ec..c4d7e8abe72 100644
--- a/llvm/tools/lto/LTOCodeGenerator.cpp
+++ b/llvm/tools/lto/LTOCodeGenerator.cpp
@@ -152,10 +152,12 @@ bool LTOCodeGenerator::writeMergedModules(const char *path,
// write bitcode to it
WriteBitcodeToFile(_linker.getModule(), Out);
-
+ Out.close();
+
if (Out.has_error()) {
errMsg = "could not write bitcode file: ";
errMsg += path;
+ Out.clear_error();
return true;
}
OpenPOWER on IntegriCloud