1 //===- BuiltinDumper.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 "BuiltinDumper.h"
11 #include "LinePrinter.h"
12 #include "llvm-pdbdump.h"
14 #include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
18 BuiltinDumper::BuiltinDumper(LinePrinter &P)
19 : PDBSymDumper(false), Printer(P) {}
21 void BuiltinDumper::start(const PDBSymbolTypeBuiltin &Symbol) {
22 PDB_BuiltinType Type = Symbol.getBuiltinType();
24 case PDB_BuiltinType::Float:
25 if (Symbol.getLength() == 4)
26 WithColor(Printer, PDB_ColorItem::Type).get() << "float";
28 WithColor(Printer, PDB_ColorItem::Type).get() << "double";
30 case PDB_BuiltinType::UInt:
31 WithColor(Printer, PDB_ColorItem::Type).get() << "unsigned";
32 if (Symbol.getLength() == 8)
33 WithColor(Printer, PDB_ColorItem::Type).get() << " __int64";
35 case PDB_BuiltinType::Int:
36 if (Symbol.getLength() == 4)
37 WithColor(Printer, PDB_ColorItem::Type).get() << "int";
39 WithColor(Printer, PDB_ColorItem::Type).get() << "__int64";
41 case PDB_BuiltinType::Char:
42 WithColor(Printer, PDB_ColorItem::Type).get() << "char";
44 case PDB_BuiltinType::WCharT:
45 WithColor(Printer, PDB_ColorItem::Type).get() << "wchar_t";
47 case PDB_BuiltinType::Void:
48 WithColor(Printer, PDB_ColorItem::Type).get() << "void";
50 case PDB_BuiltinType::Long:
51 WithColor(Printer, PDB_ColorItem::Type).get() << "long";
53 case PDB_BuiltinType::ULong:
54 WithColor(Printer, PDB_ColorItem::Type).get() << "unsigned long";
56 case PDB_BuiltinType::Bool:
57 WithColor(Printer, PDB_ColorItem::Type).get() << "bool";
59 case PDB_BuiltinType::Currency:
60 WithColor(Printer, PDB_ColorItem::Type).get() << "CURRENCY";
62 case PDB_BuiltinType::Date:
63 WithColor(Printer, PDB_ColorItem::Type).get() << "DATE";
65 case PDB_BuiltinType::Variant:
66 WithColor(Printer, PDB_ColorItem::Type).get() << "VARIANT";
68 case PDB_BuiltinType::Complex:
69 WithColor(Printer, PDB_ColorItem::Type).get() << "complex";
71 case PDB_BuiltinType::Bitfield:
72 WithColor(Printer, PDB_ColorItem::Type).get() << "bitfield";
74 case PDB_BuiltinType::BSTR:
75 WithColor(Printer, PDB_ColorItem::Type).get() << "BSTR";
77 case PDB_BuiltinType::HResult:
78 WithColor(Printer, PDB_ColorItem::Type).get() << "HRESULT";
80 case PDB_BuiltinType::BCD:
81 WithColor(Printer, PDB_ColorItem::Type).get() << "HRESULT";
84 WithColor(Printer, PDB_ColorItem::Type).get() << "void";