--- /dev/null
+// 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();
+}
--- /dev/null
+; 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
#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"
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;
+}
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;