Re-sort #include lines using my handy dandy ./utils/sort_includes.py
[oota-llvm.git] / lib / DebugInfo / PDB / PDBSymbolTypePointer.cpp
1 //===- PDBSymbolTypePointer.cpp - --------------------------------*- C++
2 //-*-===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10
11 #include "llvm/DebugInfo/PDB/IPDBSession.h"
12 #include "llvm/DebugInfo/PDB/PDBSymbol.h"
13 #include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
14 #include <utility>
15
16 using namespace llvm;
17
18 PDBSymbolTypePointer::PDBSymbolTypePointer(
19     const IPDBSession &PDBSession, std::unique_ptr<IPDBRawSymbol> Symbol)
20     : PDBSymbol(PDBSession, std::move(Symbol)) {}
21
22 void PDBSymbolTypePointer::dump(raw_ostream &OS, int Indent,
23                                 PDB_DumpLevel Level) const {
24   OS << stream_indent(Indent);
25   if (isConstType())
26     OS << "const ";
27   if (isVolatileType())
28     OS << "volatile ";
29   uint32_t PointeeId = getTypeId();
30   if (auto PointeeType = Session.getSymbolById(PointeeId))
31     PointeeType->dump(OS, 0, PDB_DumpLevel::Compact);
32   OS << ((isReference()) ? "&" : "*");
33 }