aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Support/FormattedStream.h3
-rw-r--r--include/llvm/Support/raw_ostream.h4
2 files changed, 5 insertions, 2 deletions
diff --git a/include/llvm/Support/FormattedStream.h b/include/llvm/Support/FormattedStream.h
index 8d6dca6654..11a0e18db4 100644
--- a/include/llvm/Support/FormattedStream.h
+++ b/include/llvm/Support/FormattedStream.h
@@ -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();
diff --git a/include/llvm/Support/raw_ostream.h b/include/llvm/Support/raw_ostream.h
index 09ee03098f..5f6578fcb5 100644
--- a/include/llvm/Support/raw_ostream.h
+++ b/include/llvm/Support/raw_ostream.h
@@ -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