1 //===- MinimalTypeDumper.h ------------------------------------ *- C++ --*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_LLVMPDBUTIL_MINIMAL_TYPE_DUMPER_H
10 #define LLVM_TOOLS_LLVMPDBUTIL_MINIMAL_TYPE_DUMPER_H
12 #include "llvm/DebugInfo/CodeView/TypeVisitorCallbacks.h"
13 #include "llvm/Support/BinaryStreamArray.h"
17 class LazyRandomTypeCollection
;
23 class TypeReferenceTracker
;
25 class MinimalTypeDumpVisitor
: public codeview::TypeVisitorCallbacks
{
27 MinimalTypeDumpVisitor(LinePrinter
&P
, uint32_t Width
, bool RecordBytes
,
28 bool Hashes
, codeview::LazyRandomTypeCollection
&Types
,
29 TypeReferenceTracker
*RefTracker
,
30 uint32_t NumHashBuckets
,
31 FixedStreamArray
<support::ulittle32_t
> HashValues
,
32 pdb::TpiStream
*Stream
)
33 : P(P
), Width(Width
), RecordBytes(RecordBytes
), Hashes(Hashes
),
34 Types(Types
), RefTracker(RefTracker
), NumHashBuckets(NumHashBuckets
),
35 HashValues(HashValues
), Stream(Stream
) {}
37 Error
visitTypeBegin(codeview::CVType
&Record
,
38 codeview::TypeIndex Index
) override
;
39 Error
visitTypeEnd(codeview::CVType
&Record
) override
;
40 Error
visitMemberBegin(codeview::CVMemberRecord
&Record
) override
;
41 Error
visitMemberEnd(codeview::CVMemberRecord
&Record
) override
;
43 #define TYPE_RECORD(EnumName, EnumVal, Name) \
44 Error visitKnownRecord(codeview::CVType &CVR, \
45 codeview::Name##Record &Record) override;
46 #define MEMBER_RECORD(EnumName, EnumVal, Name) \
47 Error visitKnownMember(codeview::CVMemberRecord &CVR, \
48 codeview::Name##Record &Record) override;
49 #define TYPE_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
50 #define MEMBER_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
51 #include "llvm/DebugInfo/CodeView/CodeViewTypes.def"
54 StringRef
getTypeName(codeview::TypeIndex TI
) const;
58 bool RecordBytes
= false;
60 codeview::LazyRandomTypeCollection
&Types
;
61 pdb::TypeReferenceTracker
*RefTracker
= nullptr;
62 uint32_t NumHashBuckets
;
63 codeview::TypeIndex CurrentTypeIndex
;
64 FixedStreamArray
<support::ulittle32_t
> HashValues
;
65 pdb::TpiStream
*Stream
= nullptr;