61 return 2 + Sizes[N - LF_NUMERIC];
65 const char *S =
reinterpret_cast<const char *
>(Data.
data());
73 while (!Content.
empty()) {
213 while (!Content.
empty()) {
254 if (!Content.
empty()) {
255 uint8_t Pad = Content.
front();
256 if (Pad >= LF_PAD0) {
271 Refs.
push_back({TiRefKind::TypeRef, 8, 1});
281 case TypeLeafKind::LF_FUNC_ID:
285 case TypeLeafKind::LF_MFUNC_ID:
288 case TypeLeafKind::LF_STRING_ID:
291 case TypeLeafKind::LF_SUBSTR_LIST:
296 case TypeLeafKind::LF_BUILDINFO:
301 case TypeLeafKind::LF_UDT_SRC_LINE:
305 case TypeLeafKind::LF_UDT_MOD_SRC_LINE:
308 case TypeLeafKind::LF_MODIFIER:
311 case TypeLeafKind::LF_PROCEDURE:
315 case TypeLeafKind::LF_MFUNCTION:
319 case TypeLeafKind::LF_ARGLIST:
324 case TypeLeafKind::LF_ARRAY:
327 case TypeLeafKind::LF_CLASS:
328 case TypeLeafKind::LF_STRUCTURE:
329 case TypeLeafKind::LF_INTERFACE:
332 case TypeLeafKind::LF_UNION:
335 case TypeLeafKind::LF_ENUM:
338 case TypeLeafKind::LF_BITFIELD:
341 case TypeLeafKind::LF_VFTABLE:
344 case TypeLeafKind::LF_VTSHAPE:
346 case TypeLeafKind::LF_METHODLIST:
349 case TypeLeafKind::LF_FIELDLIST:
352 case TypeLeafKind::LF_POINTER:
367 case SymbolKind::S_GPROC32:
368 case SymbolKind::S_LPROC32:
369 case SymbolKind::S_GPROC32_ID:
370 case SymbolKind::S_LPROC32_ID:
371 case SymbolKind::S_LPROC32_DPC:
372 case SymbolKind::S_LPROC32_DPC_ID:
375 case SymbolKind::S_UDT:
378 case SymbolKind::S_GDATA32:
379 case SymbolKind::S_LDATA32:
382 case SymbolKind::S_BUILDINFO:
385 case SymbolKind::S_LTHREAD32:
386 case SymbolKind::S_GTHREAD32:
389 case SymbolKind::S_FILESTATIC:
392 case SymbolKind::S_LOCAL:
395 case SymbolKind::S_REGISTER:
398 case SymbolKind::S_CONSTANT:
401 case SymbolKind::S_BPREL32:
402 case SymbolKind::S_REGREL32:
405 case SymbolKind::S_CALLSITEINFO:
408 case SymbolKind::S_CALLERS:
409 case SymbolKind::S_CALLEES:
410 case SymbolKind::S_INLINEES:
415 case SymbolKind::S_INLINESITE:
418 case SymbolKind::S_HEAPALLOCSITE:
423 case SymbolKind::S_DEFRANGE_REGISTER:
424 case SymbolKind::S_DEFRANGE_REGISTER_REL:
425 case SymbolKind::S_DEFRANGE_FRAMEPOINTER_REL:
426 case SymbolKind::S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE:
427 case SymbolKind::S_DEFRANGE_SUBFIELD_REGISTER:
428 case SymbolKind::S_DEFRANGE_SUBFIELD:
432 case SymbolKind::S_LABEL32:
433 case SymbolKind::S_OBJNAME:
434 case SymbolKind::S_COMPILE:
435 case SymbolKind::S_COMPILE2:
436 case SymbolKind::S_COMPILE3:
437 case SymbolKind::S_ENVBLOCK:
438 case SymbolKind::S_BLOCK32:
439 case SymbolKind::S_FRAMEPROC:
440 case SymbolKind::S_THUNK32:
441 case SymbolKind::S_FRAMECOOKIE:
442 case SymbolKind::S_UNAMESPACE:
445 case SymbolKind::S_END:
446 case SymbolKind::S_INLINESITE_END:
447 case SymbolKind::S_PROC_ID_END:
471 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.
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)
#define LLVM_UNLIKELY(EXPR)
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.