9 #ifndef LLVM_DEBUGINFO_CODEVIEW_RECORDITERATOR_H 10 #define LLVM_DEBUGINFO_CODEVIEW_RECORDITERATOR_H 71 template <
typename Record,
typename Func>
73 while (!StreamBuffer.
empty()) {
81 if (StreamBuffer.
size() < RealLen)
85 StreamBuffer = StreamBuffer.
drop_front(RealLen);
95 template <
typename Kind>
103 return std::move(
EC);
110 return std::move(
EC);
116 template <
typename Kind>
120 auto ExpectedRec = codeview::readCVRecordFromStream<Kind>(Stream, 0);
122 return ExpectedRec.takeError();
124 Len = ExpectedRec->length();
131 #endif // LLVM_DEBUGINFO_CODEVIEW_RECORDITERATOR_H
ArrayRef< T > take_front(size_t N=1) const
Return a copy of *this with only the first N elements.
This class represents lattice values for constants.
Error readObject(const T *&Dest)
Get a pointer to an object of type T from the underlying stream, as if by memcpy, and store the resul...
CVRecord(ArrayRef< uint8_t > Data)
SmallVector< std::pair< uint32_t, TypeIndex >, 8 > Mappings
CVRecord< Kind > OriginalRecord
ArrayRef< uint8_t > content() const
Tagged union holding either a T or a Error.
Error forEachCodeViewRecord(ArrayRef< uint8_t > StreamBuffer, Func F)
ArrayRef< uint8_t > data() const
StringRef str_data() const
size_t size() const
size - Get the array size.
Expected< CVRecord< Kind > > readCVRecordFromStream(BinaryStreamRef Stream, uint32_t Offset)
Read a complete record from a stream at a random offset.
void setOffset(uint32_t Off)
static ErrorSuccess success()
Create a success value.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
CVRecord(const RecordPrefix *P, size_t Size)
ArrayRef< uint8_t > RecordData
Error readBytes(ArrayRef< uint8_t > &Buffer, uint32_t Size)
Read Size bytes from the underlying stream at the current offset and and set Buffer to the resulting ...
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
Lightweight error class with error context and mandatory checking.
RemappedRecord(const CVRecord< Kind > &R)
Provides read only access to a subclass of BinaryStream.
StringRef - Represent a constant reference to a string, i.e.
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
bool empty() const
empty - Check if the array is empty.