60 return 2 + Sizes[N - LF_NUMERIC];
64 const char *S =
reinterpret_cast<const char *
>(Data.
data());
72 while (!Content.
empty()) {
212 while (!Content.
empty()) {
253 if (!Content.
empty()) {
254 uint8_t Pad = Content.
front();
255 if (Pad >= LF_PAD0) {
270 Refs.
push_back({TiRefKind::TypeRef, 8, 1});
280 case TypeLeafKind::LF_FUNC_ID:
284 case TypeLeafKind::LF_MFUNC_ID:
287 case TypeLeafKind::LF_STRING_ID:
290 case TypeLeafKind::LF_SUBSTR_LIST:
295 case TypeLeafKind::LF_BUILDINFO:
300 case TypeLeafKind::LF_UDT_SRC_LINE:
304 case TypeLeafKind::LF_UDT_MOD_SRC_LINE:
307 case TypeLeafKind::LF_MODIFIER:
310 case TypeLeafKind::LF_PROCEDURE:
314 case TypeLeafKind::LF_MFUNCTION:
318 case TypeLeafKind::LF_ARGLIST:
323 case TypeLeafKind::LF_ARRAY:
326 case TypeLeafKind::LF_CLASS:
327 case TypeLeafKind::LF_STRUCTURE:
328 case TypeLeafKind::LF_INTERFACE:
331 case TypeLeafKind::LF_UNION:
334 case TypeLeafKind::LF_ENUM:
337 case TypeLeafKind::LF_BITFIELD:
340 case TypeLeafKind::LF_VFTABLE:
343 case TypeLeafKind::LF_VTSHAPE:
345 case TypeLeafKind::LF_METHODLIST:
348 case TypeLeafKind::LF_FIELDLIST:
351 case TypeLeafKind::LF_POINTER:
366 case SymbolKind::S_GPROC32_ID:
367 case SymbolKind::S_LPROC32_ID:
368 case SymbolKind::S_LPROC32_DPC:
369 case SymbolKind::S_LPROC32_DPC_ID:
372 case SymbolKind::S_GPROC32:
373 case SymbolKind::S_LPROC32:
376 case SymbolKind::S_UDT:
379 case SymbolKind::S_GDATA32:
380 case SymbolKind::S_LDATA32:
383 case SymbolKind::S_BUILDINFO:
386 case SymbolKind::S_LTHREAD32:
387 case SymbolKind::S_GTHREAD32:
390 case SymbolKind::S_FILESTATIC:
393 case SymbolKind::S_LOCAL:
396 case SymbolKind::S_REGISTER:
399 case SymbolKind::S_CONSTANT:
402 case SymbolKind::S_BPREL32:
403 case SymbolKind::S_REGREL32:
406 case SymbolKind::S_CALLSITEINFO:
409 case SymbolKind::S_CALLERS:
410 case SymbolKind::S_CALLEES:
411 case SymbolKind::S_INLINEES:
416 case SymbolKind::S_INLINESITE:
419 case SymbolKind::S_HEAPALLOCSITE:
424 case SymbolKind::S_DEFRANGE_REGISTER:
425 case SymbolKind::S_DEFRANGE_REGISTER_REL:
426 case SymbolKind::S_DEFRANGE_FRAMEPOINTER_REL:
427 case SymbolKind::S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE:
428 case SymbolKind::S_DEFRANGE_SUBFIELD_REGISTER:
429 case SymbolKind::S_DEFRANGE_SUBFIELD:
433 case SymbolKind::S_LABEL32:
434 case SymbolKind::S_OBJNAME:
435 case SymbolKind::S_COMPILE:
436 case SymbolKind::S_COMPILE2:
437 case SymbolKind::S_COMPILE3:
438 case SymbolKind::S_ENVBLOCK:
439 case SymbolKind::S_BLOCK32:
440 case SymbolKind::S_FRAMEPROC:
441 case SymbolKind::S_THUNK32:
442 case SymbolKind::S_FRAMECOOKIE:
443 case SymbolKind::S_UNAMESPACE:
446 case SymbolKind::S_END:
447 case SymbolKind::S_INLINESITE_END:
448 case SymbolKind::S_PROC_ID_END:
472 for (
const auto &
Ref : Refs) {
const T & front() const
front - Get the first element.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
static uint32_t handleBaseClass(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
void discoverTypeIndices(ArrayRef< uint8_t > RecordData, SmallVectorImpl< TiReference > &Refs)
This class represents lattice values for constants.
TypeLeafKind
Duplicate copy of the above enum, but using the official CV names.
#define LLVM_UNLIKELY(EXPR)
void push_back(const T &Elt)
uint16_t read16le(const void *P)
FixedStreamArray is similar to VarStreamArray, except with each record having a fixed-length.
static uint32_t handleOneMethod(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static uint32_t handleVirtualBaseClass(ArrayRef< uint8_t > Data, uint32_t Offset, bool IsIndirect, SmallVectorImpl< TiReference > &Refs)
static void handleFieldList(ArrayRef< uint8_t > Content, SmallVectorImpl< TiReference > &Refs)
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
The access may reference the value stored in memory.
ArrayRef< uint8_t > content() const
static MethodKind getMethodKind(uint16_t Attrs)
static bool isIntroVirtual(uint16_t Attrs)
constexpr char Attrs[]
Key for Kernel::Metadata::mAttrs.
MethodKind
Part of member attribute flags. (CV_methodprop_e)
static uint32_t getCStringLength(ArrayRef< uint8_t > Data)
static uint32_t handleListContinuation(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static uint32_t getEncodedIntegerLength(ArrayRef< uint8_t > Data)
The instances of the Type class are immutable: once they are created, they are never changed...
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
bool discoverTypeIndicesInSymbol(const CVSymbol &Symbol, SmallVectorImpl< TiReference > &Refs)
Discover type indices in symbol records.
static uint32_t handleOverloadedMethod(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static uint32_t handleStaticDataMember(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static uint32_t handleEnumerator(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static void handleMethodOverloadList(ArrayRef< uint8_t > Content, SmallVectorImpl< TiReference > &Refs)
static PointerMode getPointerMode(uint32_t Attrs)
void setOffset(uint32_t Off)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
static uint32_t handleDataMember(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
PointerMode
Equivalent to CV_ptrmode_e.
static const uint32_t PointerModeMask
static void discoverTypeIndices(ArrayRef< uint8_t > Content, TypeLeafKind Kind, SmallVectorImpl< TiReference > &Refs)
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
static const uint32_t PointerModeShift
ArrayRef< uint8_t > RecordData
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
static bool isMemberPointer(uint32_t Attrs)
uint32_t read32le(const void *P)
static void resolveTypeIndexReferences(ArrayRef< uint8_t > RecordData, ArrayRef< TiReference > Refs, SmallVectorImpl< TypeIndex > &Indices)
static void handlePointer(ArrayRef< uint8_t > Content, SmallVectorImpl< TiReference > &Refs)
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
FixedStreamArrayIterator< T > end() const
static uint32_t handleVFPtr(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
Provides read only access to a subclass of BinaryStream.
static uint32_t handleNestedType(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
FixedStreamArrayIterator< T > begin() const
Error readArray(ArrayRef< T > &Array, uint32_t NumElements)
Get a reference to a NumElements element array of objects of type T from the underlying stream as if ...
bool empty() const
empty - Check if the array is empty.