9#ifndef LLVM_SUPPORT_RAW_OSTREAM_PROXY_H
10#define LLVM_SUPPORT_RAW_OSTREAM_PROXY_H
33template <
class RawOstreamT = raw_ostream>
35 void write_impl(
const char *
Ptr,
size_t Size)
override {
50 RawOstreamT::enable_colors(enable);
55 assert(OS &&
"raw_ostream_proxy_adaptor use after reset");
63 template <
class... ArgsT>
65 : RawOstreamT(
std::forward<ArgsT>(Args)...), OS(&OS),
85 size_t PreferredBufferSize;
89template <
class RawPwriteStreamT = raw_pwrite_stream>
101 template <
class... ArgsT>
104 : RawOstreamAdaptorT(OS,
std::forward<ArgsT>(Args)...) {}
114 void anchor()
override;
123 void anchor()
override;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
~raw_ostream_proxy_adaptor() override
void enable_colors(bool enable) override
raw_ostream & getProxiedOS() const
bool is_displayed() const override
This function determines if this stream is connected to a "tty" or "console" window.
raw_ostream_proxy_adaptor(raw_ostream &OS, ArgsT &&...Args)
void resetProxiedOS()
Stop proxying the stream.
size_t getPreferredBufferSize() const
void reserveExtraSpace(uint64_t ExtraSize) override
If possible, pre-allocate ExtraSize bytes for stream data.
bool has_colors() const override
This function determines if this stream is displayed and supports colors.
bool hasProxiedOS() const
raw_ostream_proxy(raw_ostream &OS)
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.
size_t GetBufferSize() const
virtual size_t preferred_buffer_size() const
Return an efficient buffer size for the underlying output mechanism.
raw_ostream & write(unsigned char C)
void SetUnbuffered()
Set the stream to be unbuffered.
virtual bool is_displayed() const
This function determines if this stream is connected to a "tty" or "console" window.
virtual void enable_colors(bool enable)
virtual void reserveExtraSpace(uint64_t ExtraSize)
If possible, pre-allocate ExtraSize bytes for stream data.
virtual bool has_colors() const
This function determines if this stream is displayed and supports colors.
raw_pwrite_stream & getProxiedOS() const
raw_pwrite_stream_proxy_adaptor()=default
raw_pwrite_stream_proxy_adaptor(raw_pwrite_stream &OS, ArgsT &&...Args)
raw_pwrite_stream_proxy(raw_pwrite_stream &OS)
An abstract base class for streams implementations that also support a pwrite operation.
void pwrite(const char *Ptr, size_t Size, uint64_t Offset)
This is an optimization pass for GlobalISel generic memory operations.
Implement std::hash so that hash_code can be used in STL containers.