[llvm-pdbdump] More advanced class definition dumping.
authorZachary Turner <zturner@google.com>
Wed, 12 Apr 2017 23:18:21 +0000 (23:18 +0000)
committerZachary Turner <zturner@google.com>
Wed, 12 Apr 2017 23:18:21 +0000 (23:18 +0000)
commitc883a8c6dce207a494c6c3a54de1492635acb664
treefb2ff9010b62853109fd592e006e560fc2cb4ed7
parent1b395144442f4bf872fb772c87d8b6e3bf78cfd7
[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
39 files changed:
llvm/include/llvm/DebugInfo/PDB/DIA/DIARawSymbol.h
llvm/include/llvm/DebugInfo/PDB/DIA/DIASession.h
llvm/include/llvm/DebugInfo/PDB/IPDBRawSymbol.h
llvm/include/llvm/DebugInfo/PDB/IPDBSession.h
llvm/include/llvm/DebugInfo/PDB/Native/NativeRawSymbol.h
llvm/include/llvm/DebugInfo/PDB/Native/NativeSession.h
llvm/include/llvm/DebugInfo/PDB/PDBSymbol.h
llvm/include/llvm/DebugInfo/PDB/PDBSymbolExe.h
llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeBaseClass.h
llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h
llvm/include/llvm/DebugInfo/PDB/PDBSymbolTypeVTable.h
llvm/include/llvm/DebugInfo/PDB/UDTLayout.h [new file with mode: 0644]
llvm/include/llvm/Support/Casting.h
llvm/lib/DebugInfo/PDB/CMakeLists.txt
llvm/lib/DebugInfo/PDB/DIA/DIARawSymbol.cpp
llvm/lib/DebugInfo/PDB/DIA/DIASession.cpp
llvm/lib/DebugInfo/PDB/Native/NativeRawSymbol.cpp
llvm/lib/DebugInfo/PDB/Native/NativeSession.cpp
llvm/lib/DebugInfo/PDB/PDBSymbol.cpp
llvm/lib/DebugInfo/PDB/PDBSymbolExe.cpp
llvm/lib/DebugInfo/PDB/PDBSymbolTypeUDT.cpp
llvm/lib/DebugInfo/PDB/UDTLayout.cpp [new file with mode: 0644]
llvm/test/DebugInfo/PDB/DIA/pdbdump-symbol-format.test
llvm/test/DebugInfo/PDB/Inputs/symbolformat.pdb
llvm/test/tools/llvm-pdbdump/Inputs/SimplePaddingTest.cpp [new file with mode: 0644]
llvm/test/tools/llvm-pdbdump/Inputs/SimplePaddingTest.pdb [new file with mode: 0644]
llvm/test/tools/llvm-pdbdump/class-layout.test
llvm/test/tools/llvm-pdbdump/enum-layout.test
llvm/test/tools/llvm-pdbdump/simple-padding.test [new file with mode: 0644]
llvm/tools/llvm-pdbdump/PrettyClassDefinitionDumper.cpp
llvm/tools/llvm-pdbdump/PrettyClassDefinitionDumper.h
llvm/tools/llvm-pdbdump/PrettyFunctionDumper.cpp
llvm/tools/llvm-pdbdump/PrettyTypeDumper.cpp
llvm/tools/llvm-pdbdump/PrettyTypedefDumper.cpp
llvm/tools/llvm-pdbdump/PrettyVariableDumper.cpp
llvm/tools/llvm-pdbdump/PrettyVariableDumper.h
llvm/tools/llvm-pdbdump/llvm-pdbdump.cpp
llvm/tools/llvm-pdbdump/llvm-pdbdump.h
llvm/unittests/DebugInfo/PDB/PDBApiTest.cpp