1 //===- PDBSymbolTypeVTable.cpp - --------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h"
12 #include "llvm/DebugInfo/PDB/IPDBSession.h"
13 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
14 #include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
15 #include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
21 PDBSymbolTypeVTable::PDBSymbolTypeVTable(const IPDBSession &PDBSession,
22 std::unique_ptr<IPDBRawSymbol> Symbol)
23 : PDBSymbol(PDBSession, std::move(Symbol)) {}
25 void PDBSymbolTypeVTable::dump(raw_ostream &OS, int Indent,
26 PDB_DumpLevel Level, PDB_DumpFlags Flags) const {
27 OS << stream_indent(Indent);
28 uint32_t ClassId = getClassParentId();
29 if (auto ClassParent = Session.getSymbolById(ClassId)) {
30 ClassParent->dump(OS, 0, PDB_DumpLevel::Compact, PDB_DF_Children);
34 if (auto VtblPointer =
35 Session.getConcreteSymbolById<PDBSymbolTypePointer>(getTypeId())) {
37 Session.getConcreteSymbolById<PDBSymbolTypeVTableShape>(
38 VtblPointer->getTypeId()))
39 OS << "(" << VtblShape->getCount() << " entries)";