15 #ifndef LLVM_SUPPORT_CIRCULAR_RAW_OSTREAM_H 16 #define LLVM_SUPPORT_CIRCULAR_RAW_OSTREAM_H 76 TheStream->
write(Cur, BufferArray + BufferSize - Cur);
78 TheStream->
write(BufferArray, Cur - BufferArray);
83 void write_impl(
const char *Ptr,
size_t Size)
override;
88 uint64_t current_pos()
const override {
109 size_t BuffSize = 0,
bool Owns = REFERENCE_ONLY)
111 OwnsStream(Owns), BufferSize(BuffSize), BufferArray(nullptr),
112 Filled(
false), Banner(Header) {
114 BufferArray =
new char[BufferSize];
123 delete[] BufferArray;
147 void releaseStream() {
~circular_raw_ostream() override
This class represents lattice values for constants.
block Block Frequency true
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...
circular_raw_ostream - A raw_ostream which can save its data to a circular buffer, or can pass it through directly to an underlying stream if specified with a buffer of zero.
void setStream(raw_ostream &Stream, bool Owns=REFERENCE_ONLY)
setStream - Tell the circular_raw_ostream to output a different stream.
raw_ostream & write(unsigned char C)
void flushBufferWithBanner()
flushBufferWithBanner - Force output of the buffer along with a small header.
static const bool REFERENCE_ONLY
REFERENCE_ONLY - Tell this stream it should not manage the held stream.
size_t GetNumBytesInBuffer() const
static const bool TAKE_OWNERSHIP
TAKE_OWNERSHIP - Tell this stream that it owns the underlying stream and is responsible for cleanup...
uint64_t tell() const
tell - Return the current offset with the file.
This class implements an extremely fast bulk output stream that can only output to a stream...