LLVM 20.0.0git
TypeRecord.h
Go to the documentation of this file.
1//===- TypeRecord.h ---------------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_DEBUGINFO_CODEVIEW_TYPERECORD_H
10#define LLVM_DEBUGINFO_CODEVIEW_TYPERECORD_H
11
12#include "llvm/ADT/APSInt.h"
13#include "llvm/ADT/ArrayRef.h"
15#include "llvm/ADT/StringRef.h"
21#include "llvm/Support/Endian.h"
22#include <algorithm>
23#include <cstdint>
24#include <optional>
25#include <vector>
26
27namespace llvm {
28namespace codeview {
29
33
37};
38
39/// Equvalent to CV_fldattr_t in cvinfo.h.
42
43 enum {
45 };
46
47 MemberAttributes() = default;
48
50 : Attrs(static_cast<uint16_t>(Access)) {}
51
53 Attrs = static_cast<uint16_t>(Access);
54 Attrs |= (static_cast<uint16_t>(Kind) << MethodKindShift);
55 Attrs |= static_cast<uint16_t>(Flags);
56 }
57
58 /// Get the access specifier. Valid for any kind of member.
60 return MemberAccess(unsigned(Attrs) & unsigned(MethodOptions::AccessMask));
61 }
62
63 /// Indicates if a method is defined with friend, virtual, static, etc.
65 return MethodKind(
66 (unsigned(Attrs) & unsigned(MethodOptions::MethodKindMask)) >>
68 }
69
70 /// Get the flags that are not included in access control or method
71 /// properties.
73 return MethodOptions(
74 unsigned(Attrs) &
76 }
77
78 /// Is this method virtual.
79 bool isVirtual() const {
80 auto MP = getMethodKind();
81 return MP != MethodKind::Vanilla && MP != MethodKind::Friend &&
83 }
84
85 /// Does this member introduce a new virtual method.
86 bool isIntroducedVirtual() const {
87 auto MP = getMethodKind();
88 return MP == MethodKind::IntroducingVirtual ||
90 }
91
92 /// Is this method static.
93 bool isStatic() const {
95 }
96};
97
98// Does not correspond to any tag, this is the tail of an LF_POINTER record
99// if it represents a member pointer.
101public:
102 MemberPointerInfo() = default;
103
107
110 return Representation;
111 }
112
116};
117
119protected:
120 TypeRecord() = default;
122
123public:
124 TypeRecordKind getKind() const { return Kind; }
125
127};
128
129// LF_MODIFIER
131public:
132 ModifierRecord() = default;
137
140
143};
144
145// LF_PROCEDURE
147public:
148 ProcedureRecord() = default;
156
162
168};
169
170// LF_MFUNCTION
172public:
175
180 : TypeRecord(TypeRecordKind::MemberFunction), ReturnType(ReturnType),
185
187 TypeIndex getClassType() const { return ClassType; }
188 TypeIndex getThisType() const { return ThisType; }
194
203};
204
205// LF_LABEL
206class LabelRecord : public TypeRecord {
207public:
208 LabelRecord() = default;
210
212
214};
215
216// LF_MFUNC_ID
218public:
223 : TypeRecord(TypeRecordKind::MemberFuncId), ClassType(ClassType),
225
226 TypeIndex getClassType() const { return ClassType; }
228 StringRef getName() const { return Name; }
229
233};
234
235// LF_ARGLIST
236class ArgListRecord : public TypeRecord {
237public:
238 ArgListRecord() = default;
240
242 : TypeRecord(Kind), ArgIndices(Indices) {}
243
245
246 std::vector<TypeIndex> ArgIndices;
247};
248
249// LF_SUBSTR_LIST
251public:
252 StringListRecord() = default;
254
256 : TypeRecord(Kind), StringIndices(Indices) {}
257
259
260 std::vector<TypeIndex> StringIndices;
261};
262
263// LF_POINTER
264class PointerRecord : public TypeRecord {
265public:
266 // ---------------------------XXXXX
267 static const uint32_t PointerKindShift = 0;
268 static const uint32_t PointerKindMask = 0x1F;
269
270 // ------------------------XXX-----
271 static const uint32_t PointerModeShift = 5;
272 static const uint32_t PointerModeMask = 0x07;
273
274 // ----------XXX------XXXXX--------
275 static const uint32_t PointerOptionMask = 0x381f00;
276
277 // -------------XXXXXX------------
278 static const uint32_t PointerSizeShift = 13;
279 static const uint32_t PointerSizeMask = 0xFF;
280
281 PointerRecord() = default;
283
286 Attrs(Attrs) {}
287
289 PointerOptions PO, uint8_t Size)
291 Attrs(calcAttrs(PK, PM, PO, Size)) {}
292
294 PointerOptions PO, uint8_t Size, const MemberPointerInfo &MPI)
296 Attrs(calcAttrs(PK, PM, PO, Size)), MemberInfo(MPI) {}
297
299
301 return static_cast<PointerKind>((Attrs >> PointerKindShift) &
303 }
304
306 return static_cast<PointerMode>((Attrs >> PointerModeShift) &
308 }
309
311 return static_cast<PointerOptions>(Attrs & PointerOptionMask);
312 }
313
314 uint8_t getSize() const {
316 }
317
319
320 bool isPointerToMember() const {
323 }
324
325 bool isFlat() const { return !!(Attrs & uint32_t(PointerOptions::Flat32)); }
326 bool isConst() const { return !!(Attrs & uint32_t(PointerOptions::Const)); }
327
328 bool isVolatile() const {
330 }
331
332 bool isUnaligned() const {
334 }
335
336 bool isRestrict() const {
338 }
339
342 }
343
346 }
347
350 std::optional<MemberPointerInfo> MemberInfo;
351
353 uint8_t Size) {
354 Attrs = calcAttrs(PK, PM, PO, Size);
355 }
356
357private:
358 static uint32_t calcAttrs(PointerKind PK, PointerMode PM, PointerOptions PO,
359 uint8_t Size) {
360 uint32_t A = 0;
361 A |= static_cast<uint32_t>(PK);
362 A |= static_cast<uint32_t>(PO);
363 A |= (static_cast<uint32_t>(PM) << PointerModeShift);
364 A |= (static_cast<uint32_t>(Size) << PointerSizeShift);
365 return A;
366 }
367};
368
369// LF_NESTTYPE
371public:
372 NestedTypeRecord() = default;
375 : TypeRecord(TypeRecordKind::NestedType), Type(Type), Name(Name) {}
376
377 TypeIndex getNestedType() const { return Type; }
378 StringRef getName() const { return Name; }
379
382};
383
384// LF_FIELDLIST
386public:
387 FieldListRecord() = default;
391
393};
394
395// LF_ARRAY
396class ArrayRecord : public TypeRecord {
397public:
398 ArrayRecord() = default;
404
406 TypeIndex getIndexType() const { return IndexType; }
407 uint64_t getSize() const { return Size; }
408 StringRef getName() const { return Name; }
409
414};
415
416class TagRecord : public TypeRecord {
417protected:
418 TagRecord() = default;
424
425public:
426 static const int HfaKindShift = 11;
427 static const int HfaKindMask = 0x1800;
428 static const int WinRTKindShift = 14;
429 static const int WinRTKindMask = 0xC000;
430
431 bool hasUniqueName() const {
433 }
434
435 bool isNested() const {
437 }
438
439 bool isForwardRef() const {
441 }
442
443 bool containsNestedClass() const {
445 }
446
447 bool isScoped() const {
449 }
450
452 ClassOptions getOptions() const { return Options; }
453 TypeIndex getFieldList() const { return FieldList; }
454 StringRef getName() const { return Name; }
456
462};
463
464// LF_CLASS, LF_STRUCTURE, LF_INTERFACE
465class ClassRecord : public TagRecord {
466public:
467 ClassRecord() = default;
475
476 HfaKind getHfa() const {
477 uint16_t Value = static_cast<uint16_t>(Options);
479 return static_cast<HfaKind>(Value);
480 }
481
483 uint16_t Value = static_cast<uint16_t>(Options);
485 return static_cast<WindowsRTClassKind>(Value);
486 }
487
490 uint64_t getSize() const { return Size; }
491
495};
496
497// LF_UNION
498struct UnionRecord : public TagRecord {
499 UnionRecord() = default;
504 UniqueName),
505 Size(Size) {}
506
507 HfaKind getHfa() const {
508 uint16_t Value = static_cast<uint16_t>(Options);
510 return static_cast<HfaKind>(Value);
511 }
512
513 uint64_t getSize() const { return Size; }
514
516};
517
518// LF_ENUM
519class EnumRecord : public TagRecord {
520public:
521 EnumRecord() = default;
526 UniqueName),
528
530
532};
533
534// LF_BITFIELD
536public:
537 BitFieldRecord() = default;
542
543 TypeIndex getType() const { return Type; }
544 uint8_t getBitOffset() const { return BitOffset; }
545 uint8_t getBitSize() const { return BitSize; }
546
548 uint8_t BitSize = 0;
549 uint8_t BitOffset = 0;
550};
551
552// LF_VTSHAPE
554public:
558 : TypeRecord(TypeRecordKind::VFTableShape), SlotsRef(Slots) {}
559 explicit VFTableShapeRecord(std::vector<VFTableSlotKind> Slots)
560 : TypeRecord(TypeRecordKind::VFTableShape), Slots(std::move(Slots)) {}
561
563 if (!SlotsRef.empty())
564 return SlotsRef;
565 return Slots;
566 }
567
568 uint32_t getEntryCount() const { return getSlots().size(); }
569
571 std::vector<VFTableSlotKind> Slots;
572};
573
574// LF_TYPESERVER2
576public:
577 TypeServer2Record() = default;
580 : TypeRecord(TypeRecordKind::TypeServer2), Age(Age), Name(Name) {
581 assert(GuidStr.size() == 16 && "guid isn't 16 bytes");
582 ::memcpy(Guid.Guid, GuidStr.data(), 16);
583 }
584
585 const GUID &getGuid() const { return Guid; }
586 uint32_t getAge() const { return Age; }
587 StringRef getName() const { return Name; }
588
589 GUID Guid = {};
592};
593
594// LF_STRING_ID
596public:
597 StringIdRecord() = default;
600 : TypeRecord(TypeRecordKind::StringId), Id(Id), String(String) {}
601
602 TypeIndex getId() const { return Id; }
603 StringRef getString() const { return String; }
604
607};
608
609// LF_FUNC_ID
610class FuncIdRecord : public TypeRecord {
611public:
612 FuncIdRecord() = default;
617
620 StringRef getName() const { return Name; }
621
625};
626
627// LF_UDT_SRC_LINE
629public:
633 : TypeRecord(TypeRecordKind::UdtSourceLine), UDT(UDT),
635
636 TypeIndex getUDT() const { return UDT; }
639
643};
644
645// LF_UDT_MOD_SRC_LINE
647public:
652 : TypeRecord(TypeRecordKind::UdtSourceLine), UDT(UDT),
654
655 TypeIndex getUDT() const { return UDT; }
658 uint16_t getModule() const { return Module; }
659
664};
665
666// LF_BUILDINFO
668public:
669 BuildInfoRecord() = default;
673
675
676 /// Indices of known build info arguments.
678 CurrentDirectory, ///< Absolute CWD path
679 BuildTool, ///< Absolute compiler path
680 SourceFile, ///< Path to main source file, relative or absolute
681 TypeServerPDB, ///< Absolute path of type server PDB (/Fd)
682 CommandLine, ///< Full canonical command line (maybe -cc1)
683 MaxArgs
684 };
685
687};
688
689// LF_VFTABLE
690class VFTableRecord : public TypeRecord {
691public:
692 VFTableRecord() = default;
696 ArrayRef<StringRef> Methods)
699 MethodNames.push_back(Name);
701 }
702
707
710 }
711
715 std::vector<StringRef> MethodNames;
716};
717
718// LF_ONEMETHOD
720public:
721 OneMethodRecord() = default;
725 : TypeRecord(TypeRecordKind::OneMethod), Type(Type), Attrs(Attrs),
729 : TypeRecord(TypeRecordKind::OneMethod), Type(Type),
731
732 TypeIndex getType() const { return Type; }
735 MemberAccess getAccess() const { return Attrs.getAccess(); }
736 int32_t getVFTableOffset() const { return VFTableOffset; }
737 StringRef getName() const { return Name; }
738
739 bool isIntroducingVirtual() const {
742 }
743
746 int32_t VFTableOffset = 0;
748};
749
750// LF_METHODLIST
752public:
757
759
760 std::vector<OneMethodRecord> Methods;
761};
762
763/// For method overload sets. LF_METHOD
765public:
770 : TypeRecord(TypeRecordKind::OverloadedMethod),
772
775 StringRef getName() const { return Name; }
776
780};
781
782// LF_MEMBER
784public:
785 DataMemberRecord() = default;
789 : TypeRecord(TypeRecordKind::DataMember), Attrs(Attrs), Type(Type),
793 : TypeRecord(TypeRecordKind::DataMember), Attrs(Access), Type(Type),
795
796 MemberAccess getAccess() const { return Attrs.getAccess(); }
797 TypeIndex getType() const { return Type; }
799 StringRef getName() const { return Name; }
800
805};
806
807// LF_STMEMBER
809public:
813 : TypeRecord(TypeRecordKind::StaticDataMember), Attrs(Attrs), Type(Type),
814 Name(Name) {}
816 : TypeRecord(TypeRecordKind::StaticDataMember), Attrs(Access), Type(Type),
817 Name(Name) {}
818
819 MemberAccess getAccess() const { return Attrs.getAccess(); }
820 TypeIndex getType() const { return Type; }
821 StringRef getName() const { return Name; }
822
826};
827
828// LF_ENUMERATE
830public:
831 EnumeratorRecord() = default;
835 Value(std::move(Value)), Name(Name) {}
838 Value(std::move(Value)), Name(Name) {}
839
840 MemberAccess getAccess() const { return Attrs.getAccess(); }
841 APSInt getValue() const { return Value; }
842 StringRef getName() const { return Name; }
843
847};
848
849// LF_VFUNCTAB
850class VFPtrRecord : public TypeRecord {
851public:
852 VFPtrRecord() = default;
855 : TypeRecord(TypeRecordKind::VFPtr), Type(Type) {}
856
857 TypeIndex getType() const { return Type; }
858
860};
861
862// LF_BCLASS, LF_BINTERFACE
864public:
865 BaseClassRecord() = default;
868 : TypeRecord(TypeRecordKind::BaseClass), Attrs(Attrs), Type(Type),
869 Offset(Offset) {}
871 : TypeRecord(TypeRecordKind::BaseClass), Attrs(Access), Type(Type),
872 Offset(Offset) {}
873
874 MemberAccess getAccess() const { return Attrs.getAccess(); }
875 TypeIndex getBaseType() const { return Type; }
876 uint64_t getBaseOffset() const { return Offset; }
877
881};
882
883// LF_VBCLASS, LF_IVBCLASS
885public:
896 : TypeRecord(Kind), Attrs(Access), BaseType(BaseType),
898
899 MemberAccess getAccess() const { return Attrs.getAccess(); }
900 TypeIndex getBaseType() const { return BaseType; }
901 TypeIndex getVBPtrType() const { return VBPtrType; }
904
910};
911
912/// LF_INDEX - Used to chain two large LF_FIELDLIST or LF_METHODLIST records
913/// together. The first will end in an LF_INDEX record that points to the next.
915public:
919 : TypeRecord(TypeRecordKind::ListContinuation),
921
923
925};
926
927// LF_PRECOMP
928class PrecompRecord : public TypeRecord {
929public:
930 PrecompRecord() = default;
932
935 uint32_t getSignature() const { return Signature; }
937
942};
943
944// LF_ENDPRECOMP
946public:
947 EndPrecompRecord() = default;
949
950 uint32_t getSignature() const { return Signature; }
951
953};
954
955} // end namespace codeview
956} // end namespace llvm
957
958#endif // LLVM_DEBUGINFO_CODEVIEW_TYPERECORD_H
This file implements the APSInt class, which is a simple class that represents an arbitrary sized int...
Lightweight arrays that are backed by an arbitrary BinaryStream.
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
std::string Name
uint64_t Size
static LVOptions Options
Definition: LVOptions.cpp:25
Profile::FuncID FuncId
Definition: Profile.cpp:321
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
An arbitrary precision integer that knows its signedness.
Definition: APSInt.h:23
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
Definition: ArrayRef.h:204
const T & front() const
front - Get the first element.
Definition: ArrayRef.h:168
size_t size() const
size - Get the array size.
Definition: ArrayRef.h:165
bool empty() const
empty - Check if the array is empty.
Definition: ArrayRef.h:160
Class to represent function types.
Definition: DerivedTypes.h:103
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1209
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
constexpr size_t size() const
size - Get the string size.
Definition: StringRef.h:137
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:131
The instances of the Type class are immutable: once they are created, they are never changed.
Definition: Type.h:45
LLVM Value Representation.
Definition: Value.h:74
std::vector< TypeIndex > ArgIndices
Definition: TypeRecord.h:246
ArrayRef< TypeIndex > getIndices() const
Definition: TypeRecord.h:244
ArgListRecord(TypeRecordKind Kind, ArrayRef< TypeIndex > Indices)
Definition: TypeRecord.h:241
ArgListRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:239
ArrayRecord(TypeIndex ElementType, TypeIndex IndexType, uint64_t Size, StringRef Name)
Definition: TypeRecord.h:400
TypeIndex getElementType() const
Definition: TypeRecord.h:405
TypeIndex getIndexType() const
Definition: TypeRecord.h:406
ArrayRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:399
uint64_t getSize() const
Definition: TypeRecord.h:407
StringRef getName() const
Definition: TypeRecord.h:408
BaseClassRecord(MemberAccess Access, TypeIndex Type, uint64_t Offset)
Definition: TypeRecord.h:870
uint64_t getBaseOffset() const
Definition: TypeRecord.h:876
TypeIndex getBaseType() const
Definition: TypeRecord.h:875
MemberAccess getAccess() const
Definition: TypeRecord.h:874
BaseClassRecord(MemberAttributes Attrs, TypeIndex Type, uint64_t Offset)
Definition: TypeRecord.h:867
BaseClassRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:866
BitFieldRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:538
TypeIndex getType() const
Definition: TypeRecord.h:543
BitFieldRecord(TypeIndex Type, uint8_t BitSize, uint8_t BitOffset)
Definition: TypeRecord.h:539
uint8_t getBitOffset() const
Definition: TypeRecord.h:544
BuildInfoRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:670
BuildInfoArg
Indices of known build info arguments.
Definition: TypeRecord.h:677
@ CurrentDirectory
Absolute CWD path.
Definition: TypeRecord.h:678
@ SourceFile
Path to main source file, relative or absolute.
Definition: TypeRecord.h:680
@ BuildTool
Absolute compiler path.
Definition: TypeRecord.h:679
@ CommandLine
Full canonical command line (maybe -cc1)
Definition: TypeRecord.h:682
@ TypeServerPDB
Absolute path of type server PDB (/Fd)
Definition: TypeRecord.h:681
BuildInfoRecord(ArrayRef< TypeIndex > ArgIndices)
Definition: TypeRecord.h:671
SmallVector< TypeIndex, MaxArgs > ArgIndices
Definition: TypeRecord.h:686
ArrayRef< TypeIndex > getArgs() const
Definition: TypeRecord.h:674
WindowsRTClassKind getWinRTKind() const
Definition: TypeRecord.h:482
ClassRecord(TypeRecordKind Kind, uint16_t MemberCount, ClassOptions Options, TypeIndex FieldList, TypeIndex DerivationList, TypeIndex VTableShape, uint64_t Size, StringRef Name, StringRef UniqueName)
Definition: TypeRecord.h:469
ClassRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:468
HfaKind getHfa() const
Definition: TypeRecord.h:476
TypeIndex getDerivationList() const
Definition: TypeRecord.h:488
uint64_t getSize() const
Definition: TypeRecord.h:490
TypeIndex getVTableShape() const
Definition: TypeRecord.h:489
MemberAccess getAccess() const
Definition: TypeRecord.h:796
DataMemberRecord(MemberAttributes Attrs, TypeIndex Type, uint64_t Offset, StringRef Name)
Definition: TypeRecord.h:787
DataMemberRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:786
uint64_t getFieldOffset() const
Definition: TypeRecord.h:798
DataMemberRecord(MemberAccess Access, TypeIndex Type, uint64_t Offset, StringRef Name)
Definition: TypeRecord.h:791
EndPrecompRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:948
EnumRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:522
TypeIndex getUnderlyingType() const
Definition: TypeRecord.h:529
EnumRecord(uint16_t MemberCount, ClassOptions Options, TypeIndex FieldList, StringRef Name, StringRef UniqueName, TypeIndex UnderlyingType)
Definition: TypeRecord.h:523
EnumeratorRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:832
EnumeratorRecord(MemberAccess Access, APSInt Value, StringRef Name)
Definition: TypeRecord.h:836
MemberAccess getAccess() const
Definition: TypeRecord.h:840
EnumeratorRecord(MemberAttributes Attrs, APSInt Value, StringRef Name)
Definition: TypeRecord.h:833
ArrayRef< uint8_t > Data
Definition: TypeRecord.h:392
FieldListRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:388
FieldListRecord(ArrayRef< uint8_t > Data)
Definition: TypeRecord.h:389
FuncIdRecord(TypeIndex ParentScope, TypeIndex FunctionType, StringRef Name)
Definition: TypeRecord.h:614
TypeIndex getFunctionType() const
Definition: TypeRecord.h:619
StringRef getName() const
Definition: TypeRecord.h:620
FuncIdRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:613
TypeIndex getParentScope() const
Definition: TypeRecord.h:618
LabelRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:209
LabelRecord(LabelType Mode)
Definition: TypeRecord.h:211
LF_INDEX - Used to chain two large LF_FIELDLIST or LF_METHODLIST records together.
Definition: TypeRecord.h:914
ListContinuationRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:917
ListContinuationRecord(TypeIndex ContinuationIndex)
Definition: TypeRecord.h:918
MemberFuncIdRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:220
MemberFuncIdRecord(TypeIndex ClassType, TypeIndex FunctionType, StringRef Name)
Definition: TypeRecord.h:221
TypeIndex getFunctionType() const
Definition: TypeRecord.h:227
int32_t getThisPointerAdjustment() const
Definition: TypeRecord.h:193
MemberFunctionRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:174
MemberFunctionRecord(TypeIndex ReturnType, TypeIndex ClassType, TypeIndex ThisType, CallingConvention CallConv, FunctionOptions Options, uint16_t ParameterCount, TypeIndex ArgumentList, int32_t ThisPointerAdjustment)
Definition: TypeRecord.h:176
FunctionOptions getOptions() const
Definition: TypeRecord.h:190
CallingConvention getCallConv() const
Definition: TypeRecord.h:189
TypeIndex getContainingType() const
Definition: TypeRecord.h:108
MemberPointerInfo(TypeIndex ContainingType, PointerToMemberRepresentation Representation)
Definition: TypeRecord.h:104
PointerToMemberRepresentation Representation
Definition: TypeRecord.h:114
PointerToMemberRepresentation getRepresentation() const
Definition: TypeRecord.h:109
std::vector< OneMethodRecord > Methods
Definition: TypeRecord.h:760
MethodOverloadListRecord(ArrayRef< OneMethodRecord > Methods)
Definition: TypeRecord.h:755
ArrayRef< OneMethodRecord > getMethods() const
Definition: TypeRecord.h:758
MethodOverloadListRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:754
ModifierRecord(TypeIndex ModifiedType, ModifierOptions Modifiers)
Definition: TypeRecord.h:134
ModifierOptions getModifiers() const
Definition: TypeRecord.h:139
ModifierRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:133
TypeIndex getModifiedType() const
Definition: TypeRecord.h:138
TypeIndex getNestedType() const
Definition: TypeRecord.h:377
NestedTypeRecord(TypeIndex Type, StringRef Name)
Definition: TypeRecord.h:374
NestedTypeRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:373
int32_t getVFTableOffset() const
Definition: TypeRecord.h:736
MemberAccess getAccess() const
Definition: TypeRecord.h:735
OneMethodRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:722
MethodOptions getOptions() const
Definition: TypeRecord.h:734
MethodKind getMethodKind() const
Definition: TypeRecord.h:733
OneMethodRecord(TypeIndex Type, MemberAccess Access, MethodKind MK, MethodOptions Options, int32_t VFTableOffset, StringRef Name)
Definition: TypeRecord.h:727
OneMethodRecord(TypeIndex Type, MemberAttributes Attrs, int32_t VFTableOffset, StringRef Name)
Definition: TypeRecord.h:723
For method overload sets. LF_METHOD.
Definition: TypeRecord.h:764
OverloadedMethodRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:767
OverloadedMethodRecord(uint16_t NumOverloads, TypeIndex MethodList, StringRef Name)
Definition: TypeRecord.h:768
static const uint32_t PointerKindShift
Definition: TypeRecord.h:267
bool isRValueReferenceThisPtr() const
Definition: TypeRecord.h:344
static const uint32_t PointerModeShift
Definition: TypeRecord.h:271
std::optional< MemberPointerInfo > MemberInfo
Definition: TypeRecord.h:350
PointerRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:282
PointerRecord(TypeIndex ReferentType, PointerKind PK, PointerMode PM, PointerOptions PO, uint8_t Size)
Definition: TypeRecord.h:288
static const uint32_t PointerOptionMask
Definition: TypeRecord.h:275
TypeIndex getReferentType() const
Definition: TypeRecord.h:298
PointerRecord(TypeIndex ReferentType, uint32_t Attrs)
Definition: TypeRecord.h:284
MemberPointerInfo getMemberInfo() const
Definition: TypeRecord.h:318
void setAttrs(PointerKind PK, PointerMode PM, PointerOptions PO, uint8_t Size)
Definition: TypeRecord.h:352
bool isLValueReferenceThisPtr() const
Definition: TypeRecord.h:340
static const uint32_t PointerSizeShift
Definition: TypeRecord.h:278
PointerMode getMode() const
Definition: TypeRecord.h:305
PointerRecord(TypeIndex ReferentType, PointerKind PK, PointerMode PM, PointerOptions PO, uint8_t Size, const MemberPointerInfo &MPI)
Definition: TypeRecord.h:293
PointerKind getPointerKind() const
Definition: TypeRecord.h:300
static const uint32_t PointerSizeMask
Definition: TypeRecord.h:279
static const uint32_t PointerKindMask
Definition: TypeRecord.h:268
PointerOptions getOptions() const
Definition: TypeRecord.h:310
static const uint32_t PointerModeMask
Definition: TypeRecord.h:272
uint32_t getSignature() const
Definition: TypeRecord.h:935
StringRef getPrecompFilePath() const
Definition: TypeRecord.h:936
PrecompRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:931
uint32_t getTypesCount() const
Definition: TypeRecord.h:934
uint32_t getStartTypeIndex() const
Definition: TypeRecord.h:933
TypeIndex getReturnType() const
Definition: TypeRecord.h:157
TypeIndex getArgumentList() const
Definition: TypeRecord.h:161
uint16_t getParameterCount() const
Definition: TypeRecord.h:160
FunctionOptions getOptions() const
Definition: TypeRecord.h:159
ProcedureRecord(TypeIndex ReturnType, CallingConvention CallConv, FunctionOptions Options, uint16_t ParameterCount, TypeIndex ArgumentList)
Definition: TypeRecord.h:150
ProcedureRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:149
CallingConvention getCallConv() const
Definition: TypeRecord.h:158
CallingConvention CallConv
Definition: TypeRecord.h:164
StaticDataMemberRecord(MemberAccess Access, TypeIndex Type, StringRef Name)
Definition: TypeRecord.h:815
StaticDataMemberRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:811
StaticDataMemberRecord(MemberAttributes Attrs, TypeIndex Type, StringRef Name)
Definition: TypeRecord.h:812
StringRef getString() const
Definition: TypeRecord.h:603
StringIdRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:598
StringIdRecord(TypeIndex Id, StringRef String)
Definition: TypeRecord.h:599
StringListRecord(TypeRecordKind Kind, ArrayRef< TypeIndex > Indices)
Definition: TypeRecord.h:255
StringListRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:253
std::vector< TypeIndex > StringIndices
Definition: TypeRecord.h:260
ArrayRef< TypeIndex > getIndices() const
Definition: TypeRecord.h:258
ClassOptions getOptions() const
Definition: TypeRecord.h:452
bool containsNestedClass() const
Definition: TypeRecord.h:443
TagRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:419
static const int WinRTKindMask
Definition: TypeRecord.h:429
uint16_t getMemberCount() const
Definition: TypeRecord.h:451
static const int WinRTKindShift
Definition: TypeRecord.h:428
TypeIndex getFieldList() const
Definition: TypeRecord.h:453
StringRef getName() const
Definition: TypeRecord.h:454
static const int HfaKindMask
Definition: TypeRecord.h:427
TagRecord(TypeRecordKind Kind, uint16_t MemberCount, ClassOptions Options, TypeIndex FieldList, StringRef Name, StringRef UniqueName)
Definition: TypeRecord.h:420
static const int HfaKindShift
Definition: TypeRecord.h:426
StringRef getUniqueName() const
Definition: TypeRecord.h:455
bool isForwardRef() const
Definition: TypeRecord.h:439
bool hasUniqueName() const
Definition: TypeRecord.h:431
A 32-bit type reference.
Definition: TypeIndex.h:96
TypeRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:121
TypeRecordKind getKind() const
Definition: TypeRecord.h:124
TypeServer2Record(TypeRecordKind Kind)
Definition: TypeRecord.h:578
const GUID & getGuid() const
Definition: TypeRecord.h:585
TypeServer2Record(StringRef GuidStr, uint32_t Age, StringRef Name)
Definition: TypeRecord.h:579
UdtModSourceLineRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:649
UdtModSourceLineRecord(TypeIndex UDT, TypeIndex SourceFile, uint32_t LineNumber, uint16_t Module)
Definition: TypeRecord.h:650
UdtSourceLineRecord(TypeIndex UDT, TypeIndex SourceFile, uint32_t LineNumber)
Definition: TypeRecord.h:632
UdtSourceLineRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:631
VFPtrRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:853
VFPtrRecord(TypeIndex Type)
Definition: TypeRecord.h:854
TypeIndex getType() const
Definition: TypeRecord.h:857
uint32_t getVFPtrOffset() const
Definition: TypeRecord.h:705
TypeIndex getOverriddenVTable() const
Definition: TypeRecord.h:704
ArrayRef< StringRef > getMethodNames() const
Definition: TypeRecord.h:708
VFTableRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:693
std::vector< StringRef > MethodNames
Definition: TypeRecord.h:715
StringRef getName() const
Definition: TypeRecord.h:706
TypeIndex getCompleteClass() const
Definition: TypeRecord.h:703
VFTableRecord(TypeIndex CompleteClass, TypeIndex OverriddenVFTable, uint32_t VFPtrOffset, StringRef Name, ArrayRef< StringRef > Methods)
Definition: TypeRecord.h:694
VFTableShapeRecord(std::vector< VFTableSlotKind > Slots)
Definition: TypeRecord.h:559
VFTableShapeRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:556
ArrayRef< VFTableSlotKind > SlotsRef
Definition: TypeRecord.h:570
VFTableShapeRecord(ArrayRef< VFTableSlotKind > Slots)
Definition: TypeRecord.h:557
ArrayRef< VFTableSlotKind > getSlots() const
Definition: TypeRecord.h:562
std::vector< VFTableSlotKind > Slots
Definition: TypeRecord.h:571
VirtualBaseClassRecord(TypeRecordKind Kind, MemberAttributes Attrs, TypeIndex BaseType, TypeIndex VBPtrType, uint64_t Offset, uint64_t Index)
Definition: TypeRecord.h:888
VirtualBaseClassRecord(TypeRecordKind Kind, MemberAccess Access, TypeIndex BaseType, TypeIndex VBPtrType, uint64_t Offset, uint64_t Index)
Definition: TypeRecord.h:893
VirtualBaseClassRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:887
PointerMode
Equivalent to CV_ptrmode_e.
Definition: CodeView.h:363
PointerOptions
Equivalent to misc lfPointerAttr bitfields.
Definition: CodeView.h:372
MethodKind
Part of member attribute flags. (CV_methodprop_e)
Definition: CodeView.h:280
PointerKind
Equivalent to CV_ptrtype_e.
Definition: CodeView.h:346
PointerToMemberRepresentation
Equivalent to CV_pmtype_e.
Definition: CodeView.h:386
CallingConvention
These values correspond to the CV_call_e enumeration, and are documented at the following locations: ...
Definition: CodeView.h:184
MethodOptions
Equivalent to CV_fldattr_t bitfield.
Definition: CodeView.h:291
MemberAccess
Source-level access specifier. (CV_access_e)
Definition: CodeView.h:272
TypeLeafKind
Duplicate copy of the above enum, but using the official CV names.
Definition: CodeView.h:34
TypeRecordKind
Distinguishes individual records in .debug$T or .debug$P section or PDB type stream.
Definition: CodeView.h:27
ModifierOptions
Equivalent to CV_modifier_t.
Definition: CodeView.h:311
LabelType
Equivalent to CV_LABEL_TYPE_e.
Definition: CodeView.h:304
detail::packed_endian_specific_integral< uint16_t, llvm::endianness::little, unaligned > ulittle16_t
Definition: Endian.h:282
detail::packed_endian_specific_integral< uint32_t, llvm::endianness::little, unaligned > ulittle32_t
Definition: Endian.h:285
detail::packed_endian_specific_integral< int32_t, llvm::endianness::little, unaligned > little32_t
Definition: Endian.h:295
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Offset
Definition: DWP.cpp:480
void append_range(Container &C, Range &&R)
Wrapper function to append range R to container C.
Definition: STLExtras.h:2098
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1856
Implement std::hash so that hash_code can be used in STL containers.
Definition: BitVector.h:858
ArrayRef< uint8_t > Data
Definition: TypeRecord.h:36
This represents the 'GUID' type from windows.h.
Definition: GUID.h:21
uint8_t Guid[16]
Definition: GUID.h:22
Equvalent to CV_fldattr_t in cvinfo.h.
Definition: TypeRecord.h:40
bool isIntroducedVirtual() const
Does this member introduce a new virtual method.
Definition: TypeRecord.h:86
bool isVirtual() const
Is this method virtual.
Definition: TypeRecord.h:79
MemberAttributes(MemberAccess Access, MethodKind Kind, MethodOptions Flags)
Definition: TypeRecord.h:52
MethodKind getMethodKind() const
Indicates if a method is defined with friend, virtual, static, etc.
Definition: TypeRecord.h:64
MethodOptions getFlags() const
Get the flags that are not included in access control or method properties.
Definition: TypeRecord.h:72
MemberAccess getAccess() const
Get the access specifier. Valid for any kind of member.
Definition: TypeRecord.h:59
bool isStatic() const
Is this method static.
Definition: TypeRecord.h:93
MemberAttributes(MemberAccess Access)
Definition: TypeRecord.h:49
uint64_t getSize() const
Definition: TypeRecord.h:513
UnionRecord(uint16_t MemberCount, ClassOptions Options, TypeIndex FieldList, uint64_t Size, StringRef Name, StringRef UniqueName)
Definition: TypeRecord.h:501
UnionRecord(TypeRecordKind Kind)
Definition: TypeRecord.h:500
HfaKind getHfa() const
Definition: TypeRecord.h:507