aboutsummaryrefslogtreecommitdiff
path: root/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h')
-rw-r--r--llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
index 369cbdc28c2e..1292bfbc0591 100644
--- a/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
+++ b/llvm/include/llvm/DebugInfo/DWARF/DWARFUnit.h
@@ -218,6 +218,7 @@ class DWARFUnit {
StringRef StringSection;
const DWARFSection &StringOffsetSection;
const DWARFSection *AddrOffsetSection;
+ DWARFUnit *SU;
Optional<uint64_t> AddrOffsetSectionBase;
bool isLittleEndian;
bool IsDWO;
@@ -251,9 +252,6 @@ class DWARFUnit {
protected:
const DWARFUnitHeader &getHeader() const { return Header; }
- /// Size in bytes of the parsed unit header.
- uint32_t getHeaderSize() const { return Header.getSize(); }
-
/// Find the unit's contribution to the string offsets table and determine its
/// length and form. The given offset is expected to be derived from the unit
/// DIE's DW_AT_str_offsets_base attribute.
@@ -290,6 +288,8 @@ public:
uint8_t getDwarfOffsetByteSize() const {
return Header.getDwarfOffsetByteSize();
}
+ /// Size in bytes of the parsed unit header.
+ uint32_t getHeaderSize() const { return Header.getSize(); }
uint64_t getLength() const { return Header.getLength(); }
dwarf::DwarfFormat getFormat() const { return Header.getFormat(); }
uint8_t getUnitType() const { return Header.getUnitType(); }
@@ -302,11 +302,21 @@ public:
return StringOffsetSection;
}
+ void setSkeletonUnit(DWARFUnit *SU) { this->SU = SU; }
+ // Returns itself if not using Split DWARF, or if the unit is a skeleton unit
+ // - otherwise returns the split full unit's corresponding skeleton, if
+ // available.
+ DWARFUnit *getLinkedUnit() { return IsDWO ? SU : this; }
+
void setAddrOffsetSection(const DWARFSection *AOS, uint64_t Base) {
AddrOffsetSection = AOS;
AddrOffsetSectionBase = Base;
}
+ Optional<uint64_t> getAddrOffsetSectionBase() const {
+ return AddrOffsetSectionBase;
+ }
+
/// Recursively update address to Die map.
void updateAddressDieMap(DWARFDie Die);
@@ -354,6 +364,8 @@ public:
return StringOffsetsTableContribution->Base;
}
+ uint64_t getAbbreviationsOffset() const { return Header.getAbbrOffset(); }
+
const DWARFAbbreviationDeclarationSet *getAbbreviations() const;
static bool isMatchingUnitTypeAndTag(uint8_t UnitType, dwarf::Tag Tag) {