14#ifndef LLVM_SUPPORT_CIRCULAR_RAW_OSTREAM_H
15#define LLVM_SUPPORT_CIRCULAR_RAW_OSTREAM_H
54 char *BufferArray =
nullptr;
75 TheStream->
write(Cur, BufferArray + BufferSize - Cur);
77 TheStream->
write(BufferArray, Cur - BufferArray);
82 void write_impl(
const char *
Ptr,
size_t Size)
override;
87 uint64_t current_pos()
const override {
110 BufferSize(BuffSize), Banner(Header) {
112 BufferArray =
new char[BufferSize];
121 delete[] BufferArray;
149 void releaseStream() {
circular_raw_ostream - A raw_ostream which can save its data to a circular buffer,...
~circular_raw_ostream() override
void flushBufferWithBanner()
flushBufferWithBanner - Force output of the buffer along with a small header.
static constexpr bool TAKE_OWNERSHIP
TAKE_OWNERSHIP - Tell this stream that it owns the underlying stream and is responsible for cleanup,...
bool is_displayed() const override
This function determines if this stream is connected to a "tty" or "console" window.
circular_raw_ostream(raw_ostream &Stream, const char *Header, size_t BuffSize=0, bool Owns=REFERENCE_ONLY)
circular_raw_ostream - Construct an optionally circular-buffered stream, handing it an underlying str...
static constexpr bool REFERENCE_ONLY
REFERENCE_ONLY - Tell this stream it should not manage the held stream.
void setStream(raw_ostream &Stream, bool Owns=REFERENCE_ONLY)
setStream - Tell the circular_raw_ostream to output a different stream.
This class implements an extremely fast bulk output stream that can only output to a stream.
uint64_t tell() const
tell - Return the current offset with the file.
raw_ostream & write(unsigned char C)
virtual bool is_displayed() const
This function determines if this stream is connected to a "tty" or "console" window.
size_t GetNumBytesInBuffer() const
This is an optimization pass for GlobalISel generic memory operations.