summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-04-12 23:18:51 +0000
committerZachary Turner <zturner@google.com>2017-04-12 23:18:51 +0000
commit9e7dda3c6df231c3f682659cccaa3abf736899c4 (patch)
tree8f61807da77853a1863cade82f1e080dee2c10e2 /llvm/lib/DebugInfo/PDB
parentc883a8c6dce207a494c6c3a54de1492635acb664 (diff)
downloadbcm5719-llvm-9e7dda3c6df231c3f682659cccaa3abf736899c4.tar.gz
bcm5719-llvm-9e7dda3c6df231c3f682659cccaa3abf736899c4.zip
[llvm-pdbdump] Minor prepatory refactor of Class Def Dumper.
In a followup patch I intend to introduce an additional dumping mode which dumps a graphical representation of a class's layout. In preparation for this, the text-based layout printer needs to be split out from the graphical layout printer, and both need to be able to use the same code for printing the intro and outro of a class's definition (e.g. base class list, etc). This patch does so, and in the process introduces a skeleton definition for the graphical printer, while currently making the graphical printer just print nothing. NFC llvm-svn: 300134
Diffstat (limited to 'llvm/lib/DebugInfo/PDB')
-rw-r--r--llvm/lib/DebugInfo/PDB/UDTLayout.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/DebugInfo/PDB/UDTLayout.cpp b/llvm/lib/DebugInfo/PDB/UDTLayout.cpp
index 71443fe7587..525913c1865 100644
--- a/llvm/lib/DebugInfo/PDB/UDTLayout.cpp
+++ b/llvm/lib/DebugInfo/PDB/UDTLayout.cpp
@@ -89,7 +89,8 @@ VTableLayoutItem::VTableLayoutItem(const UDTLayoutBase &Parent,
VTableType->getPointeeType())) {
VTableFuncs.resize(Shape->getCount());
- auto ParentFunctions = Parent.getSymbol().findAllChildren<PDBSymbolFunc>();
+ auto ParentFunctions =
+ Parent.getSymbolBase().findAllChildren<PDBSymbolFunc>();
while (auto Func = ParentFunctions->getNext()) {
if (Func->isVirtual()) {
uint32_t Index = Func->getVirtualBaseOffset();
@@ -109,15 +110,19 @@ VTableLayoutItem::VTableLayoutItem(const UDTLayoutBase &Parent,
UDTLayoutBase::UDTLayoutBase(const PDBSymbol &Symbol, const std::string &Name,
uint32_t Size)
- : Symbol(Symbol), Name(Name), SizeOf(Size) {
+ : SymbolBase(Symbol), Name(Name), SizeOf(Size) {
UsedBytes.resize(Size);
ChildrenPerByte.resize(Size);
initializeChildren(Symbol);
}
+ClassLayout::ClassLayout(const PDBSymbolTypeUDT &UDT)
+ : UDTLayoutBase(UDT, UDT.getName(), UDT.getLength()), UDT(UDT) {}
+
ClassLayout::ClassLayout(std::unique_ptr<PDBSymbolTypeUDT> UDT)
- : UDTLayoutBase(*UDT, UDT->getName(), UDT->getLength()),
- Type(std::move(UDT)) {}
+ : ClassLayout(*UDT) {
+ OwnedStorage = std::move(UDT);
+}
BaseClassLayout::BaseClassLayout(const UDTLayoutBase &Parent,
std::unique_ptr<PDBSymbolTypeBaseClass> Base)
OpenPOWER on IntegriCloud