summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-06-02 10:36:56 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-06-02 10:36:56 +0000
commit0bafa02709d4439ba9f3103631b35a90a2f3598e (patch)
tree1158b0a5ec4df3034afd081fd4337ced3d0d20c4 /clang
parent6671616cdeeb98b15c411d77d9d8c0466fab1bdb (diff)
downloadbcm5719-llvm-0bafa02709d4439ba9f3103631b35a90a2f3598e.tar.gz
bcm5719-llvm-0bafa02709d4439ba9f3103631b35a90a2f3598e.zip
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
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 125b045351d..e16a9b3ee3b 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -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
OpenPOWER on IntegriCloud