[llvm-commits] [llvm] r104882 - /llvm/trunk/tools/lto/LTOCodeGenerator.cpp
Dan Gohman
gohman at apple.com
Thu May 27 13:19:47 PDT 2010
Author: djg
Date: Thu May 27 15:19:47 2010
New Revision: 104882
URL: http://llvm.org/viewvc/llvm-project?rev=104882&view=rev
Log:
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.
Modified:
llvm/trunk/tools/lto/LTOCodeGenerator.cpp
Modified: llvm/trunk/tools/lto/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/lto/LTOCodeGenerator.cpp?rev=104882&r1=104881&r2=104882&view=diff
==============================================================================
--- llvm/trunk/tools/lto/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/tools/lto/LTOCodeGenerator.cpp Thu May 27 15:19:47 2010
@@ -152,10 +152,12 @@
// 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;
}
More information about the llvm-commits
mailing list