[llvm] Unittests and usability for BitstreamWriter incremental flushing (PR #92983)

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Fri May 24 10:50:01 PDT 2024


================
@@ -5055,13 +5055,13 @@ void llvm::WriteBitcodeToFile(const Module &M, raw_ostream &Out,
   Triple TT(M.getTargetTriple());
   if (TT.isOSDarwin() || TT.isOSBinFormatMachO())
     Buffer.insert(Buffer.begin(), BWH_HeaderSize, 0);
-
-  BitcodeWriter Writer(Buffer, dyn_cast<raw_fd_stream>(&Out));
-  Writer.writeModule(M, ShouldPreserveUseListOrder, Index, GenerateHash,
-                     ModHash);
-  Writer.writeSymtab();
-  Writer.writeStrtab();
-
+  {
----------------
teresajohnson wrote:

Why is this change needed? Is it to trigger the destructor earlier? Why is that needed when the rest of the buffer is written to Out just below here at line 5070?

https://github.com/llvm/llvm-project/pull/92983


More information about the llvm-commits mailing list