18 Attrs &=
uint16_t(MethodOptions::MethodKindMask);
25 return MK == MethodKind::IntroducingVirtual ||
26 MK == MethodKind::PureIntroducingVirtual;
36 return Mode == PointerMode::PointerToDataMember ||
37 Mode == PointerMode::PointerToMemberFunction;
61 return 2 + Sizes[
N - LF_NUMERIC];
65 const char *S =
reinterpret_cast<const char *
>(Data.data());
256 if (Pad >= LF_PAD0) {
267 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
271 Refs.
push_back({TiRefKind::TypeRef, 8, 1});
281 case TypeLeafKind::LF_FUNC_ID:
282 Refs.
push_back({TiRefKind::IndexRef, 0, 1});
283 Refs.
push_back({TiRefKind::TypeRef, 4, 1});
285 case TypeLeafKind::LF_MFUNC_ID:
286 Refs.
push_back({TiRefKind::TypeRef, 0, 2});
288 case TypeLeafKind::LF_STRING_ID:
289 Refs.
push_back({TiRefKind::IndexRef, 0, 1});
291 case TypeLeafKind::LF_SUBSTR_LIST:
294 Refs.
push_back({TiRefKind::IndexRef, 4, Count});
296 case TypeLeafKind::LF_BUILDINFO:
299 Refs.
push_back({TiRefKind::IndexRef, 2, Count});
301 case TypeLeafKind::LF_UDT_SRC_LINE:
302 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
303 Refs.
push_back({TiRefKind::IndexRef, 4, 1});
305 case TypeLeafKind::LF_UDT_MOD_SRC_LINE:
306 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
308 case TypeLeafKind::LF_MODIFIER:
309 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
311 case TypeLeafKind::LF_PROCEDURE:
312 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
313 Refs.
push_back({TiRefKind::TypeRef, 8, 1});
315 case TypeLeafKind::LF_MFUNCTION:
316 Refs.
push_back({TiRefKind::TypeRef, 0, 3});
317 Refs.
push_back({TiRefKind::TypeRef, 16, 1});
319 case TypeLeafKind::LF_ARGLIST:
322 Refs.
push_back({TiRefKind::TypeRef, 4, Count});
324 case TypeLeafKind::LF_ARRAY:
325 Refs.
push_back({TiRefKind::TypeRef, 0, 2});
327 case TypeLeafKind::LF_CLASS:
328 case TypeLeafKind::LF_STRUCTURE:
329 case TypeLeafKind::LF_INTERFACE:
330 Refs.
push_back({TiRefKind::TypeRef, 4, 3});
332 case TypeLeafKind::LF_UNION:
333 Refs.
push_back({TiRefKind::TypeRef, 4, 1});
335 case TypeLeafKind::LF_ENUM:
336 Refs.
push_back({TiRefKind::TypeRef, 4, 2});
338 case TypeLeafKind::LF_BITFIELD:
339 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
341 case TypeLeafKind::LF_VFTABLE:
342 Refs.
push_back({TiRefKind::TypeRef, 0, 2});
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_ID:
368 case SymbolKind::S_LPROC32_ID:
369 case SymbolKind::S_LPROC32_DPC:
370 case SymbolKind::S_LPROC32_DPC_ID:
371 Refs.
push_back({TiRefKind::IndexRef, 24, 1});
373 case SymbolKind::S_GPROC32:
374 case SymbolKind::S_LPROC32:
375 Refs.
push_back({TiRefKind::TypeRef, 24, 1});
377 case SymbolKind::S_UDT:
378 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
380 case SymbolKind::S_GDATA32:
381 case SymbolKind::S_LDATA32:
382 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
384 case SymbolKind::S_BUILDINFO:
385 Refs.
push_back({TiRefKind::IndexRef, 0, 1});
387 case SymbolKind::S_LTHREAD32:
388 case SymbolKind::S_GTHREAD32:
389 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
391 case SymbolKind::S_FILESTATIC:
392 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
394 case SymbolKind::S_LOCAL:
395 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
397 case SymbolKind::S_REGISTER:
398 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
400 case SymbolKind::S_CONSTANT:
401 Refs.
push_back({TiRefKind::TypeRef, 0, 1});
403 case SymbolKind::S_BPREL32:
404 case SymbolKind::S_REGREL32:
405 Refs.
push_back({TiRefKind::TypeRef, 4, 1});
407 case SymbolKind::S_CALLSITEINFO:
408 Refs.
push_back({TiRefKind::TypeRef, 8, 1});
410 case SymbolKind::S_CALLERS:
411 case SymbolKind::S_CALLEES:
412 case SymbolKind::S_INLINEES:
414 Count = *
reinterpret_cast<const ulittle32_t *
>(
Content.data());
415 Refs.
push_back({TiRefKind::IndexRef, 4, Count});
417 case SymbolKind::S_INLINESITE:
418 Refs.
push_back({TiRefKind::IndexRef, 8, 1});
420 case SymbolKind::S_HEAPALLOCSITE:
421 Refs.
push_back({TiRefKind::TypeRef, 8, 1});
425 case SymbolKind::S_DEFRANGE_REGISTER:
426 case SymbolKind::S_DEFRANGE_REGISTER_REL:
427 case SymbolKind::S_DEFRANGE_FRAMEPOINTER_REL:
428 case SymbolKind::S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE:
429 case SymbolKind::S_DEFRANGE_SUBFIELD_REGISTER:
430 case SymbolKind::S_DEFRANGE_SUBFIELD:
434 case SymbolKind::S_LABEL32:
435 case SymbolKind::S_OBJNAME:
436 case SymbolKind::S_COMPILE:
437 case SymbolKind::S_COMPILE2:
438 case SymbolKind::S_COMPILE3:
439 case SymbolKind::S_ENVBLOCK:
440 case SymbolKind::S_BLOCK32:
441 case SymbolKind::S_FRAMEPROC:
442 case SymbolKind::S_THUNK32:
443 case SymbolKind::S_FRAMECOOKIE:
444 case SymbolKind::S_UNAMESPACE:
445 case SymbolKind::S_ARMSWITCHTABLE:
448 case SymbolKind::S_END:
449 case SymbolKind::S_INLINESITE_END:
450 case SymbolKind::S_PROC_ID_END:
474 for (
const auto &
Ref : Refs) {
505 return ::discoverTypeIndices(
Sym.content(), K, Refs);
#define LLVM_UNLIKELY(EXPR)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static uint32_t getCStringLength(ArrayRef< uint8_t > Data)
static uint32_t handleDataMember(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static uint32_t handleListContinuation(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static void discoverTypeIndices(ArrayRef< uint8_t > Content, TypeLeafKind Kind, SmallVectorImpl< TiReference > &Refs)
static void resolveTypeIndexReferences(ArrayRef< uint8_t > RecordData, ArrayRef< TiReference > Refs, SmallVectorImpl< TypeIndex > &Indices)
static uint32_t handleEnumerator(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static bool isMemberPointer(uint32_t Attrs)
static uint32_t handleNestedType(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static uint32_t getEncodedIntegerLength(ArrayRef< uint8_t > Data)
static uint32_t handleVFPtr(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static uint32_t handleOneMethod(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static void handleFieldList(ArrayRef< uint8_t > Content, SmallVectorImpl< TiReference > &Refs)
static uint32_t handleBaseClass(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static void handlePointer(ArrayRef< uint8_t > Content, SmallVectorImpl< TiReference > &Refs)
static void handleMethodOverloadList(ArrayRef< uint8_t > Content, SmallVectorImpl< TiReference > &Refs)
static uint32_t handleVirtualBaseClass(ArrayRef< uint8_t > Data, uint32_t Offset, bool IsIndirect, SmallVectorImpl< TiReference > &Refs)
static PointerMode getPointerMode(uint32_t Attrs)
static MethodKind getMethodKind(uint16_t Attrs)
static uint32_t handleOverloadedMethod(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
static bool isIntroVirtual(uint16_t Attrs)
static uint32_t handleStaticDataMember(ArrayRef< uint8_t > Data, uint32_t Offset, SmallVectorImpl< TiReference > &Refs)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
bool empty() const
empty - Check if the array is empty.
Provides read only access to a subclass of BinaryStream.
void setOffset(uint64_t Off)
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 ...
FixedStreamArray is similar to VarStreamArray, except with each record having a fixed-length.
FixedStreamArrayIterator< T > begin() const
FixedStreamArrayIterator< T > end() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
void append(ItTy in_start, ItTy in_end)
Add the specified range to the end of the SmallVector.
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
The instances of the Type class are immutable: once they are created, they are never changed.
static const uint32_t PointerModeShift
static const uint32_t PointerModeMask
PointerMode
Equivalent to CV_ptrmode_e.
bool discoverTypeIndicesInSymbol(const CVSymbol &Symbol, SmallVectorImpl< TiReference > &Refs)
Discover type indices in symbol records.
MethodKind
Part of member attribute flags. (CV_methodprop_e)
void discoverTypeIndices(ArrayRef< uint8_t > RecordData, SmallVectorImpl< TiReference > &Refs)
TypeLeafKind
Duplicate copy of the above enum, but using the official CV names.
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
uint16_t read16le(const void *P)
uint32_t read32le(const void *P)
This is an optimization pass for GlobalISel generic memory operations.
@ Ref
The access may reference the value stored in memory.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.