summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-pdbdump/ClassDefinitionDumper.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2015-03-02 04:39:56 +0000
committerZachary Turner <zturner@google.com>2015-03-02 04:39:56 +0000
commit7797c726b9a864372553de4b640c540b1dae8251 (patch)
tree655a6b62386ef5b43759a072b66b3d588fea3ba1 /llvm/tools/llvm-pdbdump/ClassDefinitionDumper.cpp
parent968ceddca9a80197db8c785faf80fa9fc44ef7cd (diff)
downloadbcm5719-llvm-7797c726b9a864372553de4b640c540b1dae8251.tar.gz
bcm5719-llvm-7797c726b9a864372553de4b640c540b1dae8251.zip
[llvm-pdbdump] Many minor fixes and improvements
A short list of some of the improvements: 1) Now supports -all command line argument, which implies many other command line arguments to simplify usage. 2) Now supports -no-compiler-generated command line argument to exclude compiler generated types. 3) Prints base class list. 4) -class-definitions implies -types. 5) Proper display of bitfields. 6) Can now distinguish between struct/class/interface/union. And a few other minor tweaks. llvm-svn: 230933
Diffstat (limited to 'llvm/tools/llvm-pdbdump/ClassDefinitionDumper.cpp')
-rw-r--r--llvm/tools/llvm-pdbdump/ClassDefinitionDumper.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/llvm/tools/llvm-pdbdump/ClassDefinitionDumper.cpp b/llvm/tools/llvm-pdbdump/ClassDefinitionDumper.cpp
index 20e3fc4c795..5db33a82457 100644
--- a/llvm/tools/llvm-pdbdump/ClassDefinitionDumper.cpp
+++ b/llvm/tools/llvm-pdbdump/ClassDefinitionDumper.cpp
@@ -33,8 +33,29 @@ ClassDefinitionDumper::ClassDefinitionDumper(LinePrinter &P)
void ClassDefinitionDumper::start(const PDBSymbolTypeUDT &Class) {
std::string Name = Class.getName();
- WithColor(Printer, PDB_ColorItem::Keyword).get() << "class ";
+ WithColor(Printer, PDB_ColorItem::Keyword).get() << Class.getUdtKind() << " ";
WithColor(Printer, PDB_ColorItem::Type).get() << Class.getName();
+
+ auto Bases = Class.findAllChildren<PDBSymbolTypeBaseClass>();
+ if (Bases->getChildCount() > 0) {
+ Printer.Indent();
+ Printer.NewLine();
+ Printer << ":";
+ uint32_t BaseIndex = 0;
+ while (auto Base = Bases->getNext()) {
+ Printer << " ";
+ WithColor(Printer, PDB_ColorItem::Keyword).get() << Base->getAccess();
+ if (Base->isVirtualBaseClass())
+ WithColor(Printer, PDB_ColorItem::Keyword).get() << " virtual";
+ WithColor(Printer, PDB_ColorItem::Type).get() << " " << Base->getName();
+ if (++BaseIndex < Bases->getChildCount()) {
+ Printer.NewLine();
+ Printer << ",";
+ }
+ }
+ Printer.Unindent();
+ }
+
Printer << " {";
auto Children = Class.findAllChildren();
if (Children->getChildCount() == 0) {
@@ -62,9 +83,10 @@ void ClassDefinitionDumper::start(const PDBSymbolTypeUDT &Class) {
auto &AccessGroup = Groups.find((int)Access)->second;
if (auto Func = dyn_cast<PDBSymbolFunc>(Child.get())) {
- if (Func->isCompilerGenerated())
+ if (Func->isCompilerGenerated() && opts::ExcludeCompilerGenerated)
continue;
- if (Func->getLength() == 0 && !Func->isPureVirtual())
+ if (Func->getLength() == 0 && !Func->isPureVirtual() &&
+ !Func->isIntroVirtualFunction())
continue;
Child.release();
AccessGroup.Functions.push_back(std::unique_ptr<PDBSymbolFunc>(Func));
OpenPOWER on IntegriCloud