mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-29 22:52:18 +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
|
// own buffering, and it doesn't need or want TheStream to do another
|
||||||
// layer of buffering underneath. Resize the buffer to what TheStream
|
// layer of buffering underneath. Resize the buffer to what TheStream
|
||||||
// had been using, and tell TheStream not to do its own buffering.
|
// had been using, and tell TheStream not to do its own buffering.
|
||||||
TheStream->flush();
|
if (size_t BufferSize = TheStream->GetBufferSize())
|
||||||
if (size_t BufferSize = TheStream->GetNumBytesInBuffer())
|
|
||||||
SetBufferSize(BufferSize);
|
SetBufferSize(BufferSize);
|
||||||
TheStream->SetUnbuffered();
|
TheStream->SetUnbuffered();
|
||||||
|
|
||||||
|
@ -106,6 +106,10 @@ public:
|
|||||||
Unbuffered = false;
|
Unbuffered = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t GetBufferSize() const {
|
||||||
|
return OutBufEnd - OutBufStart;
|
||||||
|
}
|
||||||
|
|
||||||
/// SetUnbuffered - Set the streams buffering status. When
|
/// SetUnbuffered - Set the streams buffering status. When
|
||||||
/// unbuffered the stream will flush after every write. This routine
|
/// unbuffered the stream will flush after every write. This routine
|
||||||
/// will also flush the buffer immediately when the stream is being
|
/// will also flush the buffer immediately when the stream is being
|
||||||
|
Loading…
x
Reference in New Issue
Block a user