1 //===- NativeTypeEnum.h - info about enum type ------------------*- 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_PDB_NATIVE_NATIVETYPEENUM_H 10 #define LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEENUM_H 11 12 #include "llvm/ADT/Optional.h" 13 #include "llvm/DebugInfo/CodeView/TypeIndex.h" 14 #include "llvm/DebugInfo/CodeView/TypeRecord.h" 15 #include "llvm/DebugInfo/PDB/IPDBRawSymbol.h" 16 #include "llvm/DebugInfo/PDB/Native/NativeRawSymbol.h" 17 #include "llvm/DebugInfo/PDB/PDBTypes.h" 18 19 namespace llvm { 20 class raw_ostream; 21 namespace pdb { 22 23 class NativeTypeBuiltin; 24 25 class NativeTypeEnum : public NativeRawSymbol { 26 public: 27 NativeTypeEnum(NativeSession &Session, SymIndexId Id, codeview::TypeIndex TI, 28 codeview::EnumRecord Record); 29 30 NativeTypeEnum(NativeSession &Session, SymIndexId Id, 31 NativeTypeEnum &UnmodifiedType, 32 codeview::ModifierRecord Modifier); 33 ~NativeTypeEnum() override; 34 35 void dump(raw_ostream &OS, int Indent, PdbSymbolIdField ShowIdFields, 36 PdbSymbolIdField RecurseIdFields) const override; 37 38 std::unique_ptr<IPDBEnumSymbols> 39 findChildren(PDB_SymType Type) const override; 40 41 PDB_BuiltinType getBuiltinType() const override; 42 PDB_SymType getSymTag() const override; 43 SymIndexId getUnmodifiedTypeId() const override; 44 bool hasConstructor() const override; 45 bool hasAssignmentOperator() const override; 46 bool hasCastOperator() const override; 47 uint64_t getLength() const override; 48 std::string getName() const override; 49 bool isConstType() const override; 50 bool isVolatileType() const override; 51 bool isUnalignedType() const override; 52 bool isNested() const override; 53 bool hasOverloadedOperator() const override; 54 bool hasNestedTypes() const override; 55 bool isIntrinsic() const override; 56 bool isPacked() const override; 57 bool isScoped() const override; 58 SymIndexId getTypeId() const override; 59 bool isRefUdt() const override; 60 bool isValueUdt() const override; 61 bool isInterfaceUdt() const override; 62 63 const NativeTypeBuiltin &getUnderlyingBuiltinType() const; 64 const codeview::EnumRecord &getEnumRecord() const { return *Record; } 65 66 protected: 67 codeview::TypeIndex Index; 68 Optional<codeview::EnumRecord> Record; 69 NativeTypeEnum *UnmodifiedType = nullptr; 70 Optional<codeview::ModifierRecord> Modifiers; 71 }; 72 73 } // namespace pdb 74 } // namespace llvm 75 76 #endif // LLVM_DEBUGINFO_PDB_NATIVE_NATIVETYPEENUM_H 77