9 #ifndef LLVM_SUPPORT_BINARYSTREAMREF_H 10 #define LLVM_SUPPORT_BINARYSTREAMREF_H 30 Length = BorrowedImpl.getLength();
35 : SharedImpl(SharedImpl),
BorrowedImpl(SharedImpl.get()),
39 : BorrowedImpl(&BorrowedImpl),
ViewOffset(Offset), Length(Length) {}
66 RefType Result(static_cast<const RefType &>(*
this));
70 Result.ViewOffset +=
N;
71 if (Result.Length.hasValue())
83 RefType Result(static_cast<const RefType &>(*
this));
91 if (!Result.Length.hasValue())
129 if (
Length != Other.Length)
206 return {Off +
Offset, SubSub};
213 std::pair<BinarySubstreamRef, BinarySubstreamRef>
224 WritableBinaryStream> {
274 #endif // LLVM_SUPPORT_BINARYSTREAMREF_H BinarySubstreamRef slice(uint32_t Off, uint32_t Size) const
bool operator==(const RefType &Other) const
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.
BinaryStreamRefBase & operator=(const BinaryStreamRefBase &Other)=default
StreamType * BorrowedImpl
BinaryStreamRefBase(std::shared_ptr< StreamType > SharedImpl, uint32_t Offset, Optional< uint32_t > Length)
std::shared_ptr< StreamType > SharedImpl
llvm::support::endianness getEndian() const
Common stuff for mutable and immutable StreamRefs.
RefType keep_back(uint32_t N) const
Return a new BinaryStreamRef with only the last N elements remaining.
StreamType
The type of a minidump stream identifies its contents.
BinaryStreamRefBase(StreamType &BorrowedImpl, uint32_t Offset, Optional< uint32_t > Length)
Optional< uint32_t > Length
An interface for accessing data in a stream-like format, but which discourages copying.
RefType drop_back(uint32_t N) const
Return a new BinaryStreamRef with the last N elements removed.
BinarySubstreamRef drop_front(uint32_t N) const
RefType drop_front(uint32_t N) const
Return a new BinaryStreamRef with the first N elements removed.
BinaryStreamRef StreamData
uint32_t getLength() const
static ErrorSuccess success()
Create a success value.
auto size(R &&Range, typename std::enable_if< std::is_same< typename std::iterator_traits< decltype(Range.begin())>::iterator_category, std::random_access_iterator_tag >::value, void >::type *=nullptr) -> decltype(std::distance(Range.begin(), Range.end()))
Get the size of a range.
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
RefType drop_symmetric(uint32_t N) const
Return a new BinaryStreamRef with the first and last N elements removed.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
BinarySubstreamRef keep_front(uint32_t N) const
RefType keep_front(uint32_t N) const
Return a new BinaryStreamRef with only the first N elements remaining.
BinaryStreamRefBase()=default
Lightweight error class with error context and mandatory checking.
BinaryStreamRefBase(StreamType &BorrowedImpl)
StringRef - Represent a constant reference to a string, i.e.
std::pair< BinarySubstreamRef, BinarySubstreamRef > split(uint32_t Off) const
Error checkOffsetForRead(uint32_t Offset, uint32_t DataSize) const
A BinaryStream which can be read from as well as written to.