summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB/UDTLayout.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-04-25 20:22:29 +0000
committerZachary Turner <zturner@google.com>2017-04-25 20:22:29 +0000
commitda307b64ddec0c8ae3c2dead4b919636ad2c0133 (patch)
tree224cd0ec6e6acf26eaa95860cb49025c3d234a48 /llvm/lib/DebugInfo/PDB/UDTLayout.cpp
parentee3b9c2558802ae865acea5cd4a3c28913ea9847 (diff)
downloadbcm5719-llvm-da307b64ddec0c8ae3c2dead4b919636ad2c0133.tar.gz
bcm5719-llvm-da307b64ddec0c8ae3c2dead4b919636ad2c0133.zip
[llvm-pdbdump] Allow sorting / filtering by immediate padding
llvm-svn: 301358
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/UDTLayout.cpp')
-rw-r--r--llvm/lib/DebugInfo/PDB/UDTLayout.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/llvm/lib/DebugInfo/PDB/UDTLayout.cpp b/llvm/lib/DebugInfo/PDB/UDTLayout.cpp
index 6c6bb26ad1b..aacefae80c3 100644
--- a/llvm/lib/DebugInfo/PDB/UDTLayout.cpp
+++ b/llvm/lib/DebugInfo/PDB/UDTLayout.cpp
@@ -60,7 +60,6 @@ uint32_t LayoutItemBase::tailPadding() const {
return UsedBytes.size() - (Last + 1);
}
-
DataMemberLayoutItem::DataMemberLayoutItem(
const UDTLayoutBase &Parent, std::unique_ptr<PDBSymbolData> Member)
: LayoutItemBase(&Parent, Member.get(), Member->getName(),
@@ -126,13 +125,25 @@ uint32_t UDTLayoutBase::tailPadding() const {
ClassLayout::ClassLayout(const PDBSymbolTypeUDT &UDT)
: UDTLayoutBase(nullptr, UDT, UDT.getName(), 0, UDT.getLength(), false),
- UDT(UDT) {}
+ UDT(UDT) {
+ ImmediateUsedBytes.resize(SizeOf, false);
+ for (auto &LI : LayoutItems) {
+ uint32_t Begin = LI->getOffsetInParent();
+ uint32_t End = Begin + LI->getLayoutSize();
+ End = std::min(SizeOf, End);
+ ImmediateUsedBytes.set(Begin, End);
+ }
+}
ClassLayout::ClassLayout(std::unique_ptr<PDBSymbolTypeUDT> UDT)
: ClassLayout(*UDT) {
OwnedStorage = std::move(UDT);
}
+uint32_t ClassLayout::immediatePadding() const {
+ return SizeOf - ImmediateUsedBytes.count();
+}
+
BaseClassLayout::BaseClassLayout(const UDTLayoutBase &Parent,
uint32_t OffsetInParent, bool Elide,
std::unique_ptr<PDBSymbolTypeBaseClass> B)
OpenPOWER on IntegriCloud