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 //===----------------------------------------------------------------------===//
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/PDBSymbolTypeVTable.h"
16 #include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
20 PDBSymbolTypeVTable::PDBSymbolTypeVTable(const IPDBSession &PDBSession,
21 std::unique_ptr<IPDBRawSymbol> Symbol)
22 : PDBSymbol(PDBSession, std::move(Symbol)) {}
24 void PDBSymbolTypeVTable::dump(raw_ostream &OS, int Indent,
25 PDB_DumpLevel Level) const {
26 OS << stream_indent(Indent);
27 uint32_t ClassId = getClassParentId();
28 if (auto ClassParent = Session.getSymbolById(ClassId)) {
29 ClassParent->dump(OS, 0, PDB_DumpLevel::Compact);
33 if (auto VtblPointer =
34 Session.getConcreteSymbolById<PDBSymbolTypePointer>(getTypeId())) {
36 Session.getConcreteSymbolById<PDBSymbolTypeVTableShape>(
37 VtblPointer->getTypeId()))
38 OS << "(" << VtblShape->getCount() << " entries)";