File indexing completed on 2026-05-10 08:43:40
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_DEBUGINFO_CODEVIEW_TYPEDUMPVISITOR_H
0010 #define LLVM_DEBUGINFO_CODEVIEW_TYPEDUMPVISITOR_H
0011
0012 #include "llvm/ADT/StringRef.h"
0013 #include "llvm/DebugInfo/CodeView/CVRecord.h"
0014 #include "llvm/DebugInfo/CodeView/CodeView.h"
0015 #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
0016
0017 namespace llvm {
0018 class ScopedPrinter;
0019
0020 namespace codeview {
0021 class TypeIndex;
0022 struct CVMemberRecord;
0023 struct MemberAttributes;
0024
0025 class TypeCollection;
0026
0027
0028 class TypeDumpVisitor : public TypeVisitorCallbacks {
0029 public:
0030 TypeDumpVisitor(TypeCollection &TpiTypes, ScopedPrinter *W,
0031 bool PrintRecordBytes)
0032 : W(W), PrintRecordBytes(PrintRecordBytes), TpiTypes(TpiTypes) {}
0033
0034
0035
0036
0037
0038 void setIpiTypes(TypeCollection &Types) { IpiTypes = &Types; }
0039
0040 void printTypeIndex(StringRef FieldName, TypeIndex TI) const;
0041
0042 void printItemIndex(StringRef FieldName, TypeIndex TI) const;
0043
0044
0045 Error visitUnknownType(CVType &Record) override;
0046 Error visitUnknownMember(CVMemberRecord &Record) override;
0047
0048
0049
0050 Error visitTypeBegin(CVType &Record) override;
0051 Error visitTypeBegin(CVType &Record, TypeIndex Index) override;
0052 Error visitTypeEnd(CVType &Record) override;
0053 Error visitMemberBegin(CVMemberRecord &Record) override;
0054 Error visitMemberEnd(CVMemberRecord &Record) override;
0055
0056 #define TYPE_RECORD(EnumName, EnumVal, Name) \
0057 Error visitKnownRecord(CVType &CVR, Name##Record &Record) override;
0058 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
0059 Error visitKnownMember(CVMemberRecord &CVR, Name##Record &Record) override;
0060 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
0061 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
0062 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
0063
0064 private:
0065 void printMemberAttributes(MemberAttributes Attrs);
0066 void printMemberAttributes(MemberAccess Access, MethodKind Kind,
0067 MethodOptions Options);
0068
0069
0070
0071
0072 TypeCollection &getSourceTypes() const {
0073 return IpiTypes ? *IpiTypes : TpiTypes;
0074 }
0075
0076 ScopedPrinter *W;
0077
0078 bool PrintRecordBytes = false;
0079
0080 TypeCollection &TpiTypes;
0081 TypeCollection *IpiTypes = nullptr;
0082 };
0083
0084 }
0085 }
0086
0087 #endif