1 //===- PrettyExternalSymbolDumper.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 "PrettyExternalSymbolDumper.h"
11 #include "LinePrinter.h"
13 #include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
14 #include "llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h"
15 #include "llvm/Support/Format.h"
18 using namespace llvm::pdb;
20 ExternalSymbolDumper::ExternalSymbolDumper(LinePrinter &P)
21 : PDBSymDumper(true), Printer(P) {}
23 void ExternalSymbolDumper::start(const PDBSymbolExe &Symbol) {
24 if (auto Vars = Symbol.findAllChildren<PDBSymbolPublicSymbol>()) {
25 while (auto Var = Vars->getNext())
30 void ExternalSymbolDumper::dump(const PDBSymbolPublicSymbol &Symbol) {
31 std::string LinkageName = Symbol.getName();
32 if (Printer.IsSymbolExcluded(LinkageName))
36 uint64_t Addr = Symbol.getVirtualAddress();
38 Printer << "public [";
39 WithColor(Printer, PDB_ColorItem::Address).get() << format_hex(Addr, 10);
41 WithColor(Printer, PDB_ColorItem::Identifier).get() << LinkageName;