[PATCH] D52799: [llvm-pdbutil] Pretty print PDBSymbolUsingNamespace symbols
Aaron Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 11 14:40:04 PDT 2018
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rL344298: [llvm-pdbutil] Pretty print PDBSymbolUsingNamespace symbols (authored by asmith, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D52799?vs=169048&id=169309#toc
Repository:
rL LLVM
https://reviews.llvm.org/D52799
Files:
llvm/trunk/test/tools/llvm-pdbdump/Inputs/UsingNamespaceTest.cpp
llvm/trunk/test/tools/llvm-pdbdump/Inputs/UsingNamespaceTest.pdb
llvm/trunk/test/tools/llvm-pdbdump/usingnamespace.test
llvm/trunk/tools/llvm-pdbutil/PrettyCompilandDumper.cpp
llvm/trunk/tools/llvm-pdbutil/PrettyCompilandDumper.h
Index: llvm/trunk/tools/llvm-pdbutil/PrettyCompilandDumper.cpp
===================================================================
--- llvm/trunk/tools/llvm-pdbutil/PrettyCompilandDumper.cpp
+++ llvm/trunk/tools/llvm-pdbutil/PrettyCompilandDumper.cpp
@@ -28,6 +28,7 @@
#include "llvm/DebugInfo/PDB/PDBSymbolThunk.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
#include "llvm/DebugInfo/PDB/PDBSymbolUnknown.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolUsingNamespace.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
@@ -216,3 +217,13 @@
Printer.NewLine();
Printer << "unknown (" << Symbol.getSymTag() << ")";
}
+
+void CompilandDumper::dump(const PDBSymbolUsingNamespace &Symbol) {
+ if (Printer.IsSymbolExcluded(Symbol.getName()))
+ return;
+
+ Printer.NewLine();
+ Printer << "using namespace ";
+ std::string Name = Symbol.getName();
+ WithColor(Printer, PDB_ColorItem::Identifier).get() << Name;
+}
Index: llvm/trunk/tools/llvm-pdbutil/PrettyCompilandDumper.h
===================================================================
--- llvm/trunk/tools/llvm-pdbutil/PrettyCompilandDumper.h
+++ llvm/trunk/tools/llvm-pdbutil/PrettyCompilandDumper.h
@@ -34,6 +34,7 @@
void dump(const PDBSymbolThunk &Symbol) override;
void dump(const PDBSymbolTypeTypedef &Symbol) override;
void dump(const PDBSymbolUnknown &Symbol) override;
+ void dump(const PDBSymbolUsingNamespace &Symbol) override;
private:
LinePrinter &Printer;
Index: llvm/trunk/test/tools/llvm-pdbdump/Inputs/UsingNamespaceTest.cpp
===================================================================
--- llvm/trunk/test/tools/llvm-pdbdump/Inputs/UsingNamespaceTest.cpp
+++ llvm/trunk/test/tools/llvm-pdbdump/Inputs/UsingNamespaceTest.cpp
@@ -0,0 +1,11 @@
+// Compile with "cl /c /Zi /GR- UsingNamespaceTest.cpp"
+// Link with "link UsingNamespaceTest.obj /debug /nodefaultlib /entry:main"
+
+namespace NS {
+ int foo() { return 1; }
+}
+
+using namespace NS;
+int main(int argc, char **argv) {
+ return foo();
+}
Index: llvm/trunk/test/tools/llvm-pdbdump/usingnamespace.test
===================================================================
--- llvm/trunk/test/tools/llvm-pdbdump/usingnamespace.test
+++ llvm/trunk/test/tools/llvm-pdbdump/usingnamespace.test
@@ -0,0 +1,6 @@
+; RUN: llvm-pdbutil pretty -module-syms %p/Inputs/UsingNamespaceTest.pdb > %t
+; RUN: FileCheck -input-file=%t %s
+
+; CHECK: ---SYMBOLS---
+; CHECK-NEXT: {{.*}}UsingNamespaceTest.obj
+; CHECK-DAG: using namespace NS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52799.169309.patch
Type: text/x-patch
Size: 2555 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181011/60702601/attachment.bin>
More information about the llvm-commits
mailing list