Zachary Turner | 9e7dda3 | 2017-04-12 23:18:51 +0000 | [diff] [blame] | 1 | //===- 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 | |
| 17 | namespace llvm { |
| 18 | |
| 19 | namespace pdb { |
| 20 | |
Zachary Turner | 4dc4f01 | 2017-04-13 21:11:00 +0000 | [diff] [blame] | 21 | class UDTLayoutBase; |
| 22 | class StorageItemBase; |
Zachary Turner | 9e7dda3 | 2017-04-12 23:18:51 +0000 | [diff] [blame] | 23 | class LinePrinter; |
| 24 | |
| 25 | class PrettyClassLayoutGraphicalDumper : public PDBSymDumper { |
| 26 | public: |
Zachary Turner | 4dc4f01 | 2017-04-13 21:11:00 +0000 | [diff] [blame] | 27 | PrettyClassLayoutGraphicalDumper(LinePrinter &P, uint32_t InitialOffset); |
Zachary Turner | 9e7dda3 | 2017-04-12 23:18:51 +0000 | [diff] [blame] | 28 | |
Zachary Turner | 4dc4f01 | 2017-04-13 21:11:00 +0000 | [diff] [blame] | 29 | bool start(const UDTLayoutBase &Layout); |
Zachary Turner | 9e7dda3 | 2017-04-12 23:18:51 +0000 | [diff] [blame] | 30 | |
| 31 | void dump(const PDBSymbolTypeBaseClass &Symbol) override; |
| 32 | void dump(const PDBSymbolData &Symbol) override; |
Zachary Turner | 9e7dda3 | 2017-04-12 23:18:51 +0000 | [diff] [blame] | 33 | void dump(const PDBSymbolTypeVTable &Symbol) override; |
Zachary Turner | 4dc4f01 | 2017-04-13 21:11:00 +0000 | [diff] [blame] | 34 | |
| 35 | private: |
| 36 | void printPaddingRow(uint32_t Amount); |
| 37 | |
| 38 | LinePrinter &Printer; |
| 39 | |
| 40 | StorageItemBase *CurrentItem = nullptr; |
| 41 | uint32_t ClassOffsetZero = 0; |
| 42 | uint32_t CurrentAbsoluteOffset = 0; |
| 43 | bool DumpedAnything = false; |
Zachary Turner | 9e7dda3 | 2017-04-12 23:18:51 +0000 | [diff] [blame] | 44 | }; |
| 45 | } |
| 46 | } |
| 47 | #endif |