Flush the file after writing bitcode so that clients who don't close their
authorChris Lattner <sabre@nondot.org>
Sun, 6 May 2007 19:19:23 +0000 (19:19 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 6 May 2007 19:19:23 +0000 (19:19 +0000)
ofstreams will be ok.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36878 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Writer/BitcodeWriter.cpp

index 65da264b2afde09fbfab6aeb0d6dcfa98c098780..34c838343ef421e58112e817148dbc9e60400d5c 100644 (file)
@@ -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();
 }