41 NativeEnumEnumEnumerators(NativeSession &Session,
42 const NativeTypeEnum &ClassParent);
44 uint32_t getChildCount()
const override;
45 std::unique_ptr<PDBSymbol> getChildAtIndex(uint32_t Index)
const override;
46 std::unique_ptr<PDBSymbol> getNext()
override;
47 void reset()
override;
51 EnumeratorRecord &Record)
override;
53 ListContinuationRecord &Record)
override;
55 NativeSession &Session;
56 const NativeTypeEnum &ClassParent;
57 std::vector<EnumeratorRecord> Enumerators;
58 std::optional<TypeIndex> ContinuationIndex;
63NativeEnumEnumEnumerators::NativeEnumEnumEnumerators(
69 ContinuationIndex =
ClassParent.getEnumRecord().FieldList;
70 while (ContinuationIndex) {
71 CVType FieldListCVT = Types.getType(*ContinuationIndex);
73 ContinuationIndex.reset();
83 Enumerators.push_back(Record);
87Error NativeEnumEnumEnumerators::visitKnownMember(
88 CVMemberRecord &CVM, ListContinuationRecord &Record) {
93uint32_t NativeEnumEnumEnumerators::getChildCount()
const {
94 return Enumerators.size();
97std::unique_ptr<PDBSymbol>
98NativeEnumEnumEnumerators::getChildAtIndex(uint32_t Index)
const {
99 if (Index >= getChildCount())
109std::unique_ptr<PDBSymbol> NativeEnumEnumEnumerators::getNext() {
110 if (Index >= getChildCount())
113 return getChildAtIndex(Index++);
116void NativeEnumEnumEnumerators::reset() {
Index = 0; }
166std::unique_ptr<IPDBEnumSymbols>
169 return std::make_unique<NullEnumerator<PDBSymbol>>();
185 Session.getSymbolCache().findSymbolByTypeIndex(
Record->getUnderlyingType());
190 if (!Underlying.isSimple() ||
195 switch (Underlying.getSimpleKind()) {
302 const auto Id =
Session.getSymbolCache().findSymbolByTypeIndex(
303 Record->getUnderlyingType());
304 const auto UnderlyingType =
306 return UnderlyingType ? UnderlyingType->getLength() : 0;
313 return std::string(
Record->getName());
349 return Session.getSymbolCache().findSymbolByTypeIndex(
350 Record->getUnderlyingType());
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static Error visitKnownMember(CVMemberRecord &Record, TypeVisitorCallbacks &Callbacks)
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Provides amortized O(1) random access to a CodeView type stream.
TypeIndex ContinuationIndex
static Error deserializeAs(CVType &CVT, T &Record)
NativeRawSymbol(NativeSession &PDBSession, PDB_SymType Tag, SymIndexId SymbolId)
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
SymbolCache & getSymbolCache()
codeview::TypeIndex Index
bool isVolatileType() const override
bool isScoped() const override
bool hasOverloadedOperator() const override
bool isIntrinsic() const override
bool isPacked() const override
std::string getName() const override
void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, PdbSymbolIdField RecurseIdFields) const override
bool hasAssignmentOperator() const override
bool isNested() const override
bool isValueUdt() const override
bool isUnalignedType() const override
bool isInterfaceUdt() const override
std::unique_ptr< IPDBEnumSymbols > findChildren(PDB_SymType Type) const override
bool hasCastOperator() const override
PDB_BuiltinType getBuiltinType() const override
bool hasConstructor() const override
SymIndexId getTypeId() const override
bool isConstType() const override
const NativeTypeBuiltin & getUnderlyingBuiltinType() const
bool hasNestedTypes() const override
PDB_SymType getSymTag() const override
SymIndexId getUnmodifiedTypeId() const override
std::optional< codeview::ModifierRecord > Modifiers
~NativeTypeEnum() override
NativeTypeEnum * UnmodifiedType
uint64_t getLength() const override
std::optional< codeview::EnumRecord > Record
bool isRefUdt() const override
NativeTypeEnum(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI, codeview::EnumRecord Record)
Expected< TpiStream & > getPDBTpiStream()
SymIndexId getOrCreateFieldListMember(codeview::TypeIndex FieldListTI, uint32_t Index, Args &&... ConstructorArgs)
LLVM_ABI std::unique_ptr< PDBSymbol > getSymbolById(SymIndexId SymbolId) const
codeview::LazyRandomTypeCollection & typeCollection()
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
CVRecord< TypeLeafKind > CVType
@ HasConstructorOrDestructor
@ HasOverloadedAssignmentOperator
LLVM_ABI Error visitMemberRecordStream(ArrayRef< uint8_t > FieldList, TypeVisitorCallbacks &Callbacks)
@ Float32PartialPrecision
@ Complex32PartialPrecision
void dumpSymbolField(raw_ostream &OS, StringRef Name, T Value, int Indent)
PDB_BuiltinType
These values correspond to the Basictype enumeration, and are documented here: https://msdn....
PDB_SymType
These values correspond to the SymTagEnum enumeration, and are documented here: https://msdn....
IPDBEnumChildren< PDBSymbol > IPDBEnumSymbols
LLVM_ABI void dumpSymbolIdField(raw_ostream &OS, StringRef Name, SymIndexId Value, int Indent, const IPDBSession &Session, PdbSymbolIdField FieldId, PdbSymbolIdField ShowFlags, PdbSymbolIdField RecurseFlags)
This is an optimization pass for GlobalISel generic memory operations.
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.