James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame^] | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Johnson <johnson.peter@gmail.com> |
| 3 | Date: Sun, 29 Oct 2023 23:00:08 -0700 |
| 4 | Subject: [PATCH 33/33] raw_ostream: Add SetNumBytesInBuffer |
| 5 | |
| 6 | --- |
| 7 | llvm/include/llvm/Support/raw_ostream.h | 5 +++++ |
| 8 | 1 file changed, 5 insertions(+) |
| 9 | |
| 10 | diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h |
| 11 | index 9a9a1f688313a5784a58a70f2cb4cc0d6ec70e79..39f98e4e7696e28587779e90a03995463767b02d 100644 |
| 12 | --- a/llvm/include/llvm/Support/raw_ostream.h |
| 13 | +++ b/llvm/include/llvm/Support/raw_ostream.h |
| 14 | @@ -356,6 +356,11 @@ protected: |
| 15 | SetBufferAndMode(BufferStart, Size, BufferKind::ExternalBuffer); |
| 16 | } |
| 17 | |
| 18 | + /// Force-set the number of bytes in the raw_ostream buffer. |
| 19 | + void SetNumBytesInBuffer(size_t Size) { |
| 20 | + OutBufCur = OutBufStart + Size; |
| 21 | + } |
| 22 | + |
| 23 | /// Return an efficient buffer size for the underlying output mechanism. |
| 24 | virtual size_t preferred_buffer_size() const; |
| 25 | |