mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-08 03:30:22 +00:00
Add a GetBufferSize() member to raw_ostream and use it to
simplify some formatted_raw_ostream code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78836 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
114a266c94
commit
f3e488476e
@ -116,8 +116,7 @@ namespace llvm
|
||||
// own buffering, and it doesn't need or want TheStream to do another
|
||||
// layer of buffering underneath. Resize the buffer to what TheStream
|
||||
// had been using, and tell TheStream not to do its own buffering.
|
||||
TheStream->flush();
|
||||
if (size_t BufferSize = TheStream->GetNumBytesInBuffer())
|
||||
if (size_t BufferSize = TheStream->GetBufferSize())
|
||||
SetBufferSize(BufferSize);
|
||||
TheStream->SetUnbuffered();
|
||||
|
||||
|
@ -106,6 +106,10 @@ public:
|
||||
Unbuffered = false;
|
||||
}
|
||||
|
||||
size_t GetBufferSize() const {
|
||||
return OutBufEnd - OutBufStart;
|
||||
}
|
||||
|
||||
/// SetUnbuffered - Set the streams buffering status. When
|
||||
/// unbuffered the stream will flush after every write. This routine
|
||||
/// will also flush the buffer immediately when the stream is being
|
||||
|
Loading…
Reference in New Issue
Block a user