PrettyClassLayoutGraphicalDumper.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //===- PrettyClassLayoutGraphicalDumper.h -----------------------*- C++ -*-===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLVM_TOOLS_LLVMPDBDUMP_PRETTYCLASSLAYOUTGRAPHICALDUMPER_H
  9. #define LLVM_TOOLS_LLVMPDBDUMP_PRETTYCLASSLAYOUTGRAPHICALDUMPER_H
  10. #include "llvm/ADT/BitVector.h"
  11. #include "llvm/DebugInfo/PDB/PDBSymDumper.h"
  12. namespace llvm {
  13. namespace pdb {
  14. class UDTLayoutBase;
  15. class LayoutItemBase;
  16. class LinePrinter;
  17. class PrettyClassLayoutGraphicalDumper : public PDBSymDumper {
  18. public:
  19. PrettyClassLayoutGraphicalDumper(LinePrinter &P, uint32_t RecurseLevel,
  20. uint32_t InitialOffset);
  21. bool start(const UDTLayoutBase &Layout);
  22. // Layout based symbol types.
  23. void dump(const PDBSymbolTypeBaseClass &Symbol) override;
  24. void dump(const PDBSymbolData &Symbol) override;
  25. void dump(const PDBSymbolTypeVTable &Symbol) override;
  26. // Non layout-based symbol types.
  27. void dump(const PDBSymbolTypeEnum &Symbol) override;
  28. void dump(const PDBSymbolFunc &Symbol) override;
  29. void dump(const PDBSymbolTypeTypedef &Symbol) override;
  30. void dump(const PDBSymbolTypeUDT &Symbol) override;
  31. void dump(const PDBSymbolTypeBuiltin &Symbol) override;
  32. private:
  33. bool shouldRecurse() const;
  34. void printPaddingRow(uint32_t Amount);
  35. LinePrinter &Printer;
  36. LayoutItemBase *CurrentItem = nullptr;
  37. uint32_t RecursionLevel = 0;
  38. uint32_t ClassOffsetZero = 0;
  39. uint32_t CurrentAbsoluteOffset = 0;
  40. bool DumpedAnything = false;
  41. };
  42. }
  43. }
  44. #endif