Avoid calling report_fatal_error in the destructor of raw_fd_ostream

when saving a module timestamp file

This commit doesn't include a test as it requires a test that reproduces
a file write/close error that couldn't really be constructed artificially.

rdar://31860650

Differential Revision: https://reviews.llvm.org/D33357

llvm-svn: 304538
This commit is contained in:
Alex Lorenz 2017-06-02 10:36:56 +00:00
parent 6671616cde
commit 0bafa02709
1 changed files with 2 additions and 0 deletions

View File

@ -3697,6 +3697,8 @@ static void updateModuleTimestamp(ModuleFile &MF) {
if (EC)
return;
OS << "Timestamp file\n";
OS.close();
OS.clear_error(); // Avoid triggering a fatal error.
}
/// \brief Given a cursor at the start of an AST file, scan ahead and drop the