36 uint8_t EncodedBytes[10] = {0};
42 uint8_t EncodedBytes[10] = {0};
72 while (SrcReader.bytesRemaining() > 0) {
74 if (
auto EC = SrcReader.readLongestContiguousChunk(Chunk))
82 std::pair<BinaryStreamWriter, BinaryStreamWriter>
92 return std::make_pair(W1, W2);
Error writeObject(const T &Obj)
Writes the object Obj to the underlying stream, as if by using memcpy.
BinaryStreamWriter()=default
Error writeBytes(ArrayRef< uint8_t > Buffer)
Write the bytes specified in Buffer to the underlying stream.
RefType slice(uint32_t Offset, uint32_t Len) const
Return a new BinaryStreamRef with the first Offset elements removed, and retaining exactly Len elemen...
This class represents lattice values for constants.
uint32_t getLength() const
ArrayRef< uint8_t > arrayRefFromStringRef(StringRef Input)
Construct a string ref from an array ref of unsigned chars.
The access may reference the value stored in memory.
Error writeFixedString(StringRef Str)
Write the string Str to the underlying stream without a null terminator.
Error writeSLEB128(int64_t Value)
Write the unsigned integer Value to the underlying stream using ULEB128 encoding. ...
size_t size() const
size - Get the array size.
Error writeStreamRef(BinaryStreamRef Ref)
Efficiently reads all data from Ref, and writes it to this stream.
RefType drop_front(uint32_t N) const
Return a new BinaryStreamRef with the first N elements removed.
WritableBinaryStreamRef Stream
Provides write only access to a subclass of WritableBinaryStream.
Error writeInteger(T Value)
Write the integer Value to the underlying stream in the specified endianness.
This struct is a compact representation of a valid (non-zero power of two) alignment.
Error writeCString(StringRef Str)
Write the string Str to the underlying stream followed by a null terminator.
uint32_t getLength() const
static ErrorSuccess success()
Create a success value.
unsigned encodeULEB128(uint64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a ULEB128 value to an output stream.
unsigned encodeSLEB128(int64_t Value, raw_ostream &OS, unsigned PadTo=0)
Utility function to encode a SLEB128 value to an output stream.
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
std::pair< BinaryStreamWriter, BinaryStreamWriter > split(uint32_t Off) const
Splits the Writer into two Writers at a given offset.
Error writeULEB128(uint64_t Value)
Write the unsigned integer Value to the underlying stream using ULEB128 encoding. ...
uint64_t alignTo(uint64_t Size, Align A)
Returns a multiple of A needed to store Size bytes.
Error padToAlignment(uint32_t Align)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
Error writeBytes(uint32_t Offset, ArrayRef< uint8_t > Data) const
Given an Offset into this WritableBinaryStreamRef and some input data, writes the data to the underly...
RefType keep_front(uint32_t N) const
Return a new BinaryStreamRef with only the first N elements remaining.
Lightweight error class with error context and mandatory checking.
Provides read only access to a subclass of BinaryStream.
StringRef - Represent a constant reference to a string, i.e.
A BinaryStream which can be read from as well as written to.