llvm.org GIT mirror llvm / 7034ff8
[llvm-pdbutil] Pretty print PDBSymbolUsingNamespace symbols Reviewers: rnk, zturner, llvm-commits Differential Revision: https://reviews.llvm.org/D52799 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@344298 91177308-0d34-0410-b5e6-96231b3b80d8 Aaron Smith 10 months ago
5 changed file(s) with 29 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 // Compile with "cl /c /Zi /GR- UsingNamespaceTest.cpp"
1 // Link with "link UsingNamespaceTest.obj /debug /nodefaultlib /entry:main"
2
3 namespace NS {
4 int foo() { return 1; }
5 }
6
7 using namespace NS;
8 int main(int argc, char **argv) {
9 return foo();
10 }
0 ; RUN: llvm-pdbutil pretty -module-syms %p/Inputs/UsingNamespaceTest.pdb > %t
1 ; RUN: FileCheck -input-file=%t %s
2
3 ; CHECK: ---SYMBOLS---
4 ; CHECK-NEXT: {{.*}}UsingNamespaceTest.obj
5 ; CHECK-DAG: using namespace NS
2727 #include "llvm/DebugInfo/PDB/PDBSymbolThunk.h"
2828 #include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
2929 #include "llvm/DebugInfo/PDB/PDBSymbolUnknown.h"
30 #include "llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h"
3031 #include "llvm/Support/Format.h"
3132 #include "llvm/Support/Path.h"
3233 #include "llvm/Support/raw_ostream.h"
215216 Printer.NewLine();
216217 Printer << "unknown (" << Symbol.getSymTag() << ")";
217218 }
219
220 void CompilandDumper::dump(const PDBSymbolUsingNamespace &Symbol) {
221 if (Printer.IsSymbolExcluded(Symbol.getName()))
222 return;
223
224 Printer.NewLine();
225 Printer << "using namespace ";
226 std::string Name = Symbol.getName();
227 WithColor(Printer, PDB_ColorItem::Identifier).get() << Name;
228 }
3333 void dump(const PDBSymbolThunk &Symbol) override;
3434 void dump(const PDBSymbolTypeTypedef &Symbol) override;
3535 void dump(const PDBSymbolUnknown &Symbol) override;
36 void dump(const PDBSymbolUsingNamespace &Symbol) override;
3637
3738 private:
3839 LinePrinter &Printer;