diff options
Diffstat (limited to 'llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h')
-rw-r--r-- | llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h | 38 |
1 files changed, 11 insertions, 27 deletions
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h index 57fb1f1da90..f36f470980b 100644 --- a/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h +++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugInfoEntry.h @@ -31,13 +31,14 @@ class DWARFDebugInfoEntry { /// Offset within the .debug_info of the start of this entry. uint32_t Offset; - /// How many to add to "this" to get the sibling. - uint32_t SiblingIdx; + /// The integer depth of this DIE within the compile unit DIEs where the + /// compile/type unit DIE has a depth of zero. + uint32_t Depth; const DWARFAbbreviationDeclaration *AbbrevDecl; public: DWARFDebugInfoEntry() - : Offset(0), SiblingIdx(0), AbbrevDecl(nullptr) {} + : Offset(0), Depth(0), AbbrevDecl(nullptr) {} /// Extracts a debug info entry, which is a child of a given unit, /// starting at a given offset. If DIE can't be extracted, returns false and @@ -45,33 +46,16 @@ public: bool extractFast(const DWARFUnit &U, uint32_t *OffsetPtr); /// High performance extraction should use this call. bool extractFast(const DWARFUnit &U, uint32_t *OffsetPtr, - const DataExtractor &DebugInfoData, uint32_t UEndOffset); + const DataExtractor &DebugInfoData, + uint32_t UEndOffset, + uint32_t Depth); uint32_t getOffset() const { return Offset; } - bool hasChildren() const { return AbbrevDecl && AbbrevDecl->hasChildren(); } - - // We know we are kept in a vector of contiguous entries, so we know - // our sibling will be some index after "this". - const DWARFDebugInfoEntry *getSibling() const { - return SiblingIdx > 0 ? this + SiblingIdx : nullptr; - } - - // We know we are kept in a vector of contiguous entries, so we know - // we don't need to store our child pointer, if we have a child it will - // be the next entry in the list... - const DWARFDebugInfoEntry *getFirstChild() const { - return hasChildren() ? this + 1 : nullptr; + uint32_t getDepth() const { return Depth; } + dwarf::Tag getTag() const { + return AbbrevDecl ? AbbrevDecl->getTag() : dwarf::DW_TAG_null; } - - void setSibling(const DWARFDebugInfoEntry *Sibling) { - if (Sibling) { - // We know we are kept in a vector of contiguous entries, so we know - // our sibling will be some index after "this". - SiblingIdx = Sibling - this; - } else - SiblingIdx = 0; - } - + bool hasChildren() const { return AbbrevDecl && AbbrevDecl->hasChildren(); } const DWARFAbbreviationDeclaration *getAbbreviationDeclarationPtr() const { return AbbrevDecl; } |