[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / llvm / tools / llvm-pdbutil / PrettyExternalSymbolDumper.cpp
blob34436c572c8aaa311a14b0d5a1dd3e81850484fb
1 //===- PrettyExternalSymbolDumper.cpp -------------------------- *- C++ *-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "PrettyExternalSymbolDumper.h"
11 #include "llvm/DebugInfo/PDB/ConcreteSymbolEnumerator.h"
12 #include "llvm/DebugInfo/PDB/Native/LinePrinter.h"
13 #include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
14 #include "llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h"
15 #include "llvm/Support/Format.h"
17 using namespace llvm;
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())
26 Var->dump(*this);
30 void ExternalSymbolDumper::dump(const PDBSymbolPublicSymbol &Symbol) {
31 std::string LinkageName = Symbol.getName();
32 if (Printer.IsSymbolExcluded(LinkageName))
33 return;
35 Printer.NewLine();
36 uint64_t Addr = Symbol.getVirtualAddress();
38 Printer << "public [";
39 WithColor(Printer, PDB_ColorItem::Address).get() << format_hex(Addr, 10);
40 Printer << "] ";
41 WithColor(Printer, PDB_ColorItem::Identifier).get() << LinkageName;