Go to the documentation of this file.
9 #ifndef LLVM_SUPPORT_BINARYSTREAMREF_H
10 #define LLVM_SUPPORT_BINARYSTREAMREF_H
33 std::optional<uint64_t>
Length)
37 std::optional<uint64_t>
Length)
65 RefType Result(
static_cast<const RefType &
>(*
this));
69 Result.ViewOffset +=
N;
82 RefType Result(
static_cast<const RefType &
>(*
this));
124 if (
LHS.BorrowedImpl !=
RHS.BorrowedImpl)
126 if (
LHS.ViewOffset !=
RHS.ViewOffset)
128 if (
LHS.Length !=
RHS.Length)
160 std::optional<uint64_t>
Length)
167 std::optional<uint64_t>
Length);
205 return {Off +
Offset, SubSub};
212 std::pair<BinarySubstreamRef, BinarySubstreamRef>
split(
uint64_t Off)
const {
222 WritableBinaryStream> {
241 std::optional<uint64_t>
Length);
272 #endif // LLVM_SUPPORT_BINARYSTREAMREF_H
Error readLongestContiguousChunk(uint64_t Offset, ArrayRef< uint8_t > &Buffer) const
Given an Offset into this BinaryStreamRef, return a reference to the largest buffer the stream could ...
An interface for accessing data in a stream-like format, but which discourages copying.
This is an optimization pass for GlobalISel generic memory operations.
WritableBinaryStreamRef & operator=(const WritableBinaryStreamRef &Other)=default
BinaryStreamRef()=default
static ErrorSuccess success()
Create a success value.
BinaryStreamRefBase & operator=(const BinaryStreamRefBase &Other)=default
BinaryStreamRefBase(StreamType &BorrowedImpl, uint64_t Offset, std::optional< uint64_t > Length)
Error checkOffsetForRead(uint64_t Offset, uint64_t DataSize) const
BinarySubstreamRef drop_front(uint64_t N) const
Error commit()
For buffered streams, commits changes to the backing store.
RefType drop_symmetric(uint64_t N) const
Return a new BinaryStreamRef with the first and last N elements removed.
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
RefType drop_back(uint64_t N) const
Return a new BinaryStreamRef with the last N elements removed.
std::shared_ptr< StreamType > SharedImpl
uint64_t getLength() const
BinaryStreamRef StreamData
RefType keep_front(uint64_t N) const
Return a new BinaryStreamRef with only the first N elements remaining.
BinaryStreamRefBase(std::shared_ptr< StreamType > SharedImpl, uint64_t Offset, std::optional< uint64_t > Length)
StreamType
The type of a minidump stream identifies its contents.
WritableBinaryStreamRef()=default
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
BinaryStreamRefBase()=default
Expected< ExpressionValue > min(const ExpressionValue &Lhs, const ExpressionValue &Rhs)
Common stuff for mutable and immutable StreamRefs.
StringRef - Represent a constant reference to a string, i.e.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
llvm::support::endianness getEndian() const
friend bool operator==(const RefType &LHS, const RefType &RHS)
BinarySubstreamRef slice(uint64_t Off, uint64_t Size) const
std::pair< BinarySubstreamRef, BinarySubstreamRef > split(uint64_t Off) const
BinarySubstreamRef keep_front(uint64_t N) const
RefType slice(uint64_t Offset, uint64_t Len) const
Return a new BinaryStreamRef with the first Offset elements removed, and retaining exactly Len elemen...
Lightweight error class with error context and mandatory checking.
BinaryStreamRefBase(StreamType &BorrowedImpl)
StreamType * BorrowedImpl
std::optional< uint64_t > Length
RefType keep_back(uint64_t N) const
Return a new BinaryStreamRef with only the last N elements remaining.
Error writeBytes(uint64_t Offset, ArrayRef< uint8_t > Data) const
Given an Offset into this WritableBinaryStreamRef and some input data, writes the data to the underly...
Error readBytes(uint64_t Offset, uint64_t Size, ArrayRef< uint8_t > &Buffer) const
Given an Offset into this StreamRef and a Size, return a reference to a buffer owned by the stream.
std::optional< std::vector< StOtherPiece > > Other
BinaryStreamRef & operator=(const BinaryStreamRef &Other)=default
A BinaryStream which can be read from as well as written to.
RefType drop_front(uint64_t N) const
Return a new BinaryStreamRef with the first N elements removed.
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
BinaryStreamFlags getFlags() const override
Return the properties of this stream.