summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-04-12 23:18:21 +0000
committerZachary Turner <zturner@google.com>2017-04-12 23:18:21 +0000
commitc883a8c6dce207a494c6c3a54de1492635acb664 (patch)
treefb2ff9010b62853109fd592e006e560fc2cb4ed7 /llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
parent1b395144442f4bf872fb772c87d8b6e3bf78cfd7 (diff)
downloadbcm5719-llvm-c883a8c6dce207a494c6c3a54de1492635acb664.tar.gz
bcm5719-llvm-c883a8c6dce207a494c6c3a54de1492635acb664.zip
[llvm-pdbdump] More advanced class definition dumping.
Previously the dumping of class definitions was very primitive, and it made it hard to do more than the most trivial of output formats when dumping. As such, we would only dump one line for each field, and then dump non-layout items like nested types and enums. With this patch, we do a complete analysis of the object hierarchy including aggregate types, bases, virtual bases, vftable analysis, etc. The only immediately visible effects of this are that a) we can now dump a line for the vfptr where before we would treat that as padding, and b) we now don't treat virtual bases that come at the end of a class as padding since we have a more detailed analysis of the class's storage usage. In subsequent patches, we should be able to use this analysis to display a complete graphical view of a class's layout including recursing arbitrarily deep into an object's base class / aggregate member hierarchy. llvm-svn: 300133
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/PDBSymbol.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/PDBSymbol.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp b/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
index 2c8438f9c23..14eb6ba8ad8 100644
--- a/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
+++ b/llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
@@ -54,6 +54,9 @@ PDBSymbol::PDBSymbol(const IPDBSession &PDBSession,
std::unique_ptr<IPDBRawSymbol> Symbol)
: Session(PDBSession), RawSymbol(std::move(Symbol)) {}
+PDBSymbol::PDBSymbol(PDBSymbol &Symbol)
+ : Session(Symbol.Session), RawSymbol(std::move(Symbol.RawSymbol)) {}
+
PDBSymbol::~PDBSymbol() = default;
#define FACTORY_SYMTAG_CASE(Tag, Type) \
@@ -100,12 +103,6 @@ PDBSymbol::create(const IPDBSession &PDBSession,
}
}
-#define TRY_DUMP_TYPE(Type) \
- if (const Type *DerivedThis = this->cast<Type>()) \
- Dumper.dump(OS, Indent, *DerivedThis);
-
-#define ELSE_TRY_DUMP_TYPE(Type, Dumper) else TRY_DUMP_TYPE(Type, Dumper)
-
void PDBSymbol::defaultDump(raw_ostream &OS, int Indent) const {
RawSymbol->dump(OS, Indent);
}
OpenPOWER on IntegriCloud