aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-06 19:19:23 +0000
committerChris Lattner <sabre@nondot.org>2007-05-06 19:19:23 +0000
commit44f8ad1d40cac7cafda447882199a08bdb1f5a48 (patch)
tree1249e020e6e384cb5e566d54eeffd27ef04181cc /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent9b4a428978272fbb5200ee1378244846d7ef56d5 (diff)
downloadllvm-44f8ad1d40cac7cafda447882199a08bdb1f5a48.zip
llvm-44f8ad1d40cac7cafda447882199a08bdb1f5a48.tar.gz
llvm-44f8ad1d40cac7cafda447882199a08bdb1f5a48.tar.bz2
Flush the file after writing bitcode so that clients who don't close their
ofstreams will be ok. llvm-svn: 36878
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 65da264b..34c8383 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1201,4 +1201,7 @@ void llvm::WriteBitcodeToFile(const Module *M, std::ostream &Out) {
// Write the generated bitstream to "Out".
Out.write((char*)&Buffer.front(), Buffer.size());
+
+ // Make sure it hits disk now.
+ Out.flush();
}