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

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 14:18:59 PDT 2024


================
@@ -28,34 +29,42 @@
 namespace llvm {
 
 class BitstreamWriter {
-  /// Out - The buffer that keeps unflushed bytes.
-  SmallVectorImpl<char> &Out;
-
-  /// FS - The file stream that Out flushes to. If FS is nullptr, it does not
-  /// support read or seek, Out cannot be flushed until all data are written.
-  raw_fd_stream *FS;
-
-  /// FlushThreshold - If FS is valid, this is the threshold (unit B) to flush
-  /// FS.
+  /// Owned buffer, used to init Buffer if the provided stream doesn't happen to
+  /// be a buffer itself.
+  SmallVector<char, 0> OwnBuffer;
+  /// Internal buffer. The writer backpatches, so it is efficient to buffer.
----------------
mtrofin wrote:

done.


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


More information about the llvm-commits mailing list