aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/ASTUnit.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-08-15 16:54:31 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-08-15 16:54:31 +0000
commit1395c5d00588a9c3154683ffe6c223bb7af2fbf2 (patch)
tree8ffc8d21f2e756c000d4d17a29fc8fcdece88750 /lib/Frontend/ASTUnit.cpp
parent96872c44700bcfc184bf99a6755898e7930f65ed (diff)
Open AST/PCH files in binary mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111106 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/ASTUnit.cpp')
-rw-r--r--lib/Frontend/ASTUnit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Frontend/ASTUnit.cpp b/lib/Frontend/ASTUnit.cpp
index 8d49d4e786..8ac5b681a6 100644
--- a/lib/Frontend/ASTUnit.cpp
+++ b/lib/Frontend/ASTUnit.cpp
@@ -1598,7 +1598,8 @@ bool ASTUnit::Save(llvm::StringRef File) {
// FIXME: Can we somehow regenerate the stat cache here, or do we need to
// unconditionally create a stat cache when we parse the file?
std::string ErrorInfo;
- llvm::raw_fd_ostream Out(File.str().c_str(), ErrorInfo);
+ llvm::raw_fd_ostream Out(File.str().c_str(), ErrorInfo,
+ llvm::raw_fd_ostream::F_Binary);
if (!ErrorInfo.empty() || Out.has_error())
return true;
@@ -1609,7 +1610,6 @@ bool ASTUnit::Save(llvm::StringRef File) {
// Write the generated bitstream to "Out".
Out.write((char *)&Buffer.front(), Buffer.size());
- Out.flush();
Out.close();
return Out.has_error();
}