mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-01 00:02:16 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104882 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
756a96a328
commit
4b7416b75d
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user