1 //===- PrettyClassLayoutGraphicalDumper.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_LLVMPDBDUMP_PRETTYCLASSLAYOUTGRAPHICALDUMPER_H
10 #define LLVM_TOOLS_LLVMPDBDUMP_PRETTYCLASSLAYOUTGRAPHICALDUMPER_H
12 #include "llvm/ADT/BitVector.h"
14 #include "llvm/DebugInfo/PDB/PDBSymDumper.h"
24 class PrettyClassLayoutGraphicalDumper : public PDBSymDumper {
26 PrettyClassLayoutGraphicalDumper(LinePrinter &P, uint32_t RecurseLevel,
27 uint32_t InitialOffset);
29 bool start(const UDTLayoutBase &Layout);
31 // Layout based symbol types.
32 void dump(const PDBSymbolTypeBaseClass &Symbol) override;
33 void dump(const PDBSymbolData &Symbol) override;
34 void dump(const PDBSymbolTypeVTable &Symbol) override;
36 // Non layout-based symbol types.
37 void dump(const PDBSymbolTypeEnum &Symbol) override;
38 void dump(const PDBSymbolFunc &Symbol) override;
39 void dump(const PDBSymbolTypeTypedef &Symbol) override;
40 void dump(const PDBSymbolTypeUDT &Symbol) override;
41 void dump(const PDBSymbolTypeBuiltin &Symbol) override;
44 bool shouldRecurse() const;
45 void printPaddingRow(uint32_t Amount);
49 LayoutItemBase *CurrentItem = nullptr;
50 uint32_t RecursionLevel = 0;
51 uint32_t ClassOffsetZero = 0;
52 uint32_t CurrentAbsoluteOffset = 0;
53 bool DumpedAnything = false;