aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-pdbdump/BuiltinDumper.cpp
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2015-04-10 22:08:18 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-10 22:08:18 +0000
commit13a7db5b9c4f5e543d037be68ec3428216bfd550 (patch)
tree1b2c9792582e12f5af0b1512e3094425f0dc0df9 /tools/llvm-pdbdump/BuiltinDumper.cpp
parent0eb46f5d1e06a4284663d636a74b06adc3a161d7 (diff)
parent31195f0bdca6ee2a5e72d07edf13e1d81206d949 (diff)
downloadexternal_llvm-13a7db5b9c4f5e543d037be68ec3428216bfd550.zip
external_llvm-13a7db5b9c4f5e543d037be68ec3428216bfd550.tar.gz
external_llvm-13a7db5b9c4f5e543d037be68ec3428216bfd550.tar.bz2
am 31195f0b: Merge "Update aosp/master llvm for rebase to r233350"
* commit '31195f0bdca6ee2a5e72d07edf13e1d81206d949': Update aosp/master llvm for rebase to r233350
Diffstat (limited to 'tools/llvm-pdbdump/BuiltinDumper.cpp')
-rw-r--r--tools/llvm-pdbdump/BuiltinDumper.cpp87
1 files changed, 87 insertions, 0 deletions
diff --git a/tools/llvm-pdbdump/BuiltinDumper.cpp b/tools/llvm-pdbdump/BuiltinDumper.cpp
new file mode 100644
index 0000000..d808298
--- /dev/null
+++ b/tools/llvm-pdbdump/BuiltinDumper.cpp
@@ -0,0 +1,87 @@
+//===- BuiltinDumper.cpp ---------------------------------------- *- C++ *-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "BuiltinDumper.h"
+#include "LinePrinter.h"
+#include "llvm-pdbdump.h"
+
+#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
+
+using namespace llvm;
+
+BuiltinDumper::BuiltinDumper(LinePrinter &P)
+ : PDBSymDumper(false), Printer(P) {}
+
+void BuiltinDumper::start(const PDBSymbolTypeBuiltin &Symbol) {
+ PDB_BuiltinType Type = Symbol.getBuiltinType();
+ switch (Type) {
+ case PDB_BuiltinType::Float:
+ if (Symbol.getLength() == 4)
+ WithColor(Printer, PDB_ColorItem::Type).get() << "float";
+ else
+ WithColor(Printer, PDB_ColorItem::Type).get() << "double";
+ break;
+ case PDB_BuiltinType::UInt:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "unsigned";
+ if (Symbol.getLength() == 8)
+ WithColor(Printer, PDB_ColorItem::Type).get() << " __int64";
+ break;
+ case PDB_BuiltinType::Int:
+ if (Symbol.getLength() == 4)
+ WithColor(Printer, PDB_ColorItem::Type).get() << "int";
+ else
+ WithColor(Printer, PDB_ColorItem::Type).get() << "__int64";
+ break;
+ case PDB_BuiltinType::Char:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "char";
+ break;
+ case PDB_BuiltinType::WCharT:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "wchar_t";
+ break;
+ case PDB_BuiltinType::Void:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "void";
+ break;
+ case PDB_BuiltinType::Long:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "long";
+ break;
+ case PDB_BuiltinType::ULong:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "unsigned long";
+ break;
+ case PDB_BuiltinType::Bool:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "bool";
+ break;
+ case PDB_BuiltinType::Currency:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "CURRENCY";
+ break;
+ case PDB_BuiltinType::Date:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "DATE";
+ break;
+ case PDB_BuiltinType::Variant:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "VARIANT";
+ break;
+ case PDB_BuiltinType::Complex:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "complex";
+ break;
+ case PDB_BuiltinType::Bitfield:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "bitfield";
+ break;
+ case PDB_BuiltinType::BSTR:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "BSTR";
+ break;
+ case PDB_BuiltinType::HResult:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "HRESULT";
+ break;
+ case PDB_BuiltinType::BCD:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "HRESULT";
+ break;
+ default:
+ WithColor(Printer, PDB_ColorItem::Type).get() << "void";
+ break;
+ }
+}