blob: f83f1a6c1b34fae6ce7e17633e98c725ee0f103a [file] [log] [blame]
Zachary Turner67dcd802017-04-12 23:18:51 +00001//===- PrettyClassLayoutGraphicalDumper.h -----------------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLVM_TOOLS_LLVMPDBDUMP_PRETTYCLASSLAYOUTGRAPHICALDUMPER_H
11#define LLVM_TOOLS_LLVMPDBDUMP_PRETTYCLASSLAYOUTGRAPHICALDUMPER_H
12
13#include "llvm/ADT/BitVector.h"
14
15#include "llvm/DebugInfo/PDB/PDBSymDumper.h"
16
17namespace llvm {
18
19namespace pdb {
20
Zachary Turner10683342017-04-13 21:11:00 +000021class UDTLayoutBase;
Zachary Turner0e8b7072017-04-24 17:47:24 +000022class LayoutItemBase;
Zachary Turner67dcd802017-04-12 23:18:51 +000023class LinePrinter;
24
25class PrettyClassLayoutGraphicalDumper : public PDBSymDumper {
26public:
Zachary Turner41374872017-04-24 17:47:52 +000027 PrettyClassLayoutGraphicalDumper(LinePrinter &P, uint32_t RecurseLevel,
28 uint32_t InitialOffset);
Zachary Turner67dcd802017-04-12 23:18:51 +000029
Zachary Turner10683342017-04-13 21:11:00 +000030 bool start(const UDTLayoutBase &Layout);
Zachary Turner67dcd802017-04-12 23:18:51 +000031
Zachary Turner41374872017-04-24 17:47:52 +000032 // Layout based symbol types.
Zachary Turner67dcd802017-04-12 23:18:51 +000033 void dump(const PDBSymbolTypeBaseClass &Symbol) override;
34 void dump(const PDBSymbolData &Symbol) override;
Zachary Turner67dcd802017-04-12 23:18:51 +000035 void dump(const PDBSymbolTypeVTable &Symbol) override;
Zachary Turner10683342017-04-13 21:11:00 +000036
Zachary Turner41374872017-04-24 17:47:52 +000037 // Non layout-based symbol types.
38 void dump(const PDBSymbolTypeEnum &Symbol) override;
39 void dump(const PDBSymbolFunc &Symbol) override;
40 void dump(const PDBSymbolTypeTypedef &Symbol) override;
41 void dump(const PDBSymbolTypeUDT &Symbol) override;
42 void dump(const PDBSymbolTypeBuiltin &Symbol) override;
43
Zachary Turner10683342017-04-13 21:11:00 +000044private:
Zachary Turner41374872017-04-24 17:47:52 +000045 bool shouldRecurse() const;
Zachary Turner10683342017-04-13 21:11:00 +000046 void printPaddingRow(uint32_t Amount);
47
48 LinePrinter &Printer;
49
Zachary Turner0e8b7072017-04-24 17:47:24 +000050 LayoutItemBase *CurrentItem = nullptr;
Zachary Turner41374872017-04-24 17:47:52 +000051 uint32_t RecursionLevel = 0;
Zachary Turner10683342017-04-13 21:11:00 +000052 uint32_t ClassOffsetZero = 0;
53 uint32_t CurrentAbsoluteOffset = 0;
54 bool DumpedAnything = false;
Zachary Turner67dcd802017-04-12 23:18:51 +000055};
56}
57}
58#endif