Re-sort #include lines using my handy dandy ./utils/sort_includes.py
[oota-llvm.git] / lib / DebugInfo / PDB / PDBSymbolTypeVTable.cpp
1 //===- PDBSymbolTypeVTable.cpp - --------------------------------*- 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 #include "llvm/DebugInfo/PDB/IPDBSession.h"
11 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
12 #include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
13 #include "llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h"
14 #include "llvm/DebugInfo/PDB/PDBSymbolTypeVTableShape.h"
15 #include <utility>
16
17 using namespace llvm;
18
19 PDBSymbolTypeVTable::PDBSymbolTypeVTable(const IPDBSession &PDBSession,
20                                          std::unique_ptr<IPDBRawSymbol> Symbol)
21     : PDBSymbol(PDBSession, std::move(Symbol)) {}
22
23 void PDBSymbolTypeVTable::dump(raw_ostream &OS, int Indent,
24                                PDB_DumpLevel Level) const {
25   OS << stream_indent(Indent);
26   uint32_t ClassId = getClassParentId();
27   if (auto ClassParent = Session.getSymbolById(ClassId)) {
28     ClassParent->dump(OS, 0, PDB_DumpLevel::Compact);
29     OS << "::";
30   }
31   OS << "<vtbl> ";
32   if (auto VtblPointer =
33           Session.getConcreteSymbolById<PDBSymbolTypePointer>(getTypeId())) {
34     if (auto VtblShape =
35             Session.getConcreteSymbolById<PDBSymbolTypeVTableShape>(
36                 VtblPointer->getTypeId()))
37       OS << "(" << VtblShape->getCount() << " entries)";
38   }
39   OS.flush();
40 }