forked from wpilibsuite/allwpilib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The previous fix didn't handle all cases correctly. Instead, add a new function to raw_ostream (SetNumBytesInBuffer) to allow always using the full buffer size, and revamp write_impl to more cleanly handle all cases.
- Loading branch information
1 parent
366b715
commit 0067f4f
Showing
4 changed files
with
61 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
upstream_utils/llvm_patches/0033-raw_ostream-Add-SetNumBytesInBuffer.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Peter Johnson <johnson.peter@gmail.com> | ||
Date: Sun, 29 Oct 2023 23:00:08 -0700 | ||
Subject: [PATCH 33/33] raw_ostream: Add SetNumBytesInBuffer | ||
|
||
--- | ||
llvm/include/llvm/Support/raw_ostream.h | 5 +++++ | ||
1 file changed, 5 insertions(+) | ||
|
||
diff --git a/llvm/include/llvm/Support/raw_ostream.h b/llvm/include/llvm/Support/raw_ostream.h | ||
index 9a9a1f688313a5784a58a70f2cb4cc0d6ec70e79..39f98e4e7696e28587779e90a03995463767b02d 100644 | ||
--- a/llvm/include/llvm/Support/raw_ostream.h | ||
+++ b/llvm/include/llvm/Support/raw_ostream.h | ||
@@ -356,6 +356,11 @@ protected: | ||
SetBufferAndMode(BufferStart, Size, BufferKind::ExternalBuffer); | ||
} | ||
|
||
+ /// Force-set the number of bytes in the raw_ostream buffer. | ||
+ void SetNumBytesInBuffer(size_t Size) { | ||
+ OutBufCur = OutBufStart + Size; | ||
+ } | ||
+ | ||
/// Return an efficient buffer size for the underlying output mechanism. | ||
virtual size_t preferred_buffer_size() const; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters