9#ifndef LLVM_DEBUGINFO_CODEVIEW_CVRECORD_H
10#define LLVM_DEBUGINFO_CODEVIEW_CVRECORD_H
45 return static_cast<Kind
>(
static_cast<uint16_t>(
67template <
typename Record,
typename Func>
69 while (!StreamBuffer.
empty()) {
76 size_t RealLen = Prefix->RecordLen + 2;
77 if (StreamBuffer.
size() < RealLen)
81 StreamBuffer = StreamBuffer.
drop_front(RealLen);
91template <
typename Kind>
100 if (Prefix->RecordLen < 2)
106 return std::move(
EC);
112template <
typename Kind>
116 auto ExpectedRec = codeview::readCVRecordFromStream<Kind>(Stream, 0);
118 return ExpectedRec.takeError();
120 Len = ExpectedRec->length();
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
ArrayRef< T > take_front(size_t N=1) const
Return a copy of *this with only the first N elements.
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
size_t size() const
size - Get the array size.
bool empty() const
empty - Check if the array is empty.
Provides read only access to a subclass of BinaryStream.
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...
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 ...
void setOffset(uint64_t Off)
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
StringRef - Represent a constant reference to a string, i.e.
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
CVRecord(ArrayRef< uint8_t > Data)
StringRef str_data() const
CVRecord(const RecordPrefix *P, size_t Size)
ArrayRef< uint8_t > data() const
ArrayRef< uint8_t > RecordData
ArrayRef< uint8_t > content() const
A range adaptor for a pair of iterators.
Error forEachCodeViewRecord(ArrayRef< uint8_t > StreamBuffer, Func F)
Expected< CVRecord< Kind > > readCVRecordFromStream(BinaryStreamRef Stream, uint32_t Offset)
Read a complete record from a stream at a random offset.
This is an optimization pass for GlobalISel generic memory operations.