60 while (SrcReader.bytesRemaining() > 0) {
62 if (
auto EC = SrcReader.readLongestContiguousChunk(Chunk))
70 std::pair<BinaryStreamWriter, BinaryStreamWriter>
80 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
constexpr char Align[]
Key for Kernel::Arg::Metadata::mAlign.
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.
uint64_t alignTo(uint64_t Value, uint64_t Align, uint64_t Skew=0)
Returns the next integer (mod 2**64) that is greater than or equal to Value and is a multiple of Alig...
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.
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.
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.
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 padToAlignment(uint32_t Align)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.