diff options
| author | David Blaikie <dblaikie@gmail.com> | 2019-11-12 14:15:37 -0800 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2019-11-15 18:51:13 -0800 |
| commit | 77cfcd75092b57693d40123a013e59295634a945 (patch) | |
| tree | 1199d6a4ddee2a0351d11eacd99f2ec373a8f156 /llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | |
| parent | 97c742e6b74e731afdef74dd5f8366ce883e0520 (diff) | |
| download | bcm5719-llvm-77cfcd75092b57693d40123a013e59295634a945.tar.gz bcm5719-llvm-77cfcd75092b57693d40123a013e59295634a945.zip | |
DebugInfo: Use loclistx for DWARFv5 location lists to reduce the number of relocations
This only implements the non-dwo part, but loclistx is necessary to use
location lists in DWARFv5, so it's a precursor to that work - and
generally reduces relocations (only using one reloc, then
indexes/relative offsets for all location list references) in non-split
DWARF.
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFDie.cpp')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp index 49a7f7dc2a5..7fa72b1bb57 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp @@ -96,6 +96,13 @@ static void dumpLocation(raw_ostream &OS, DWARFFormValue &FormValue, uint64_t Offset = *FormValue.getAsSectionOffset(); + if (FormValue.getForm() == DW_FORM_loclistx) { + FormValue.dump(OS, DumpOpts); + if (auto LoclistOffset = U->getLoclistOffset(Offset)) + Offset = *LoclistOffset + U->getLocSectionBase(); + else + return; + } U->getLocationTable().dumpLocationList(&Offset, OS, U->getBaseAddress(), MRI, U, LLDumpOpts, Indent); return; @@ -409,6 +416,10 @@ Optional<uint64_t> DWARFDie::getRangesBaseAttribute() const { return toSectionOffset(find({DW_AT_rnglists_base, DW_AT_GNU_ranges_base})); } +Optional<uint64_t> DWARFDie::getLocBaseAttribute() const { + return toSectionOffset(find(DW_AT_loclists_base)); +} + Optional<uint64_t> DWARFDie::getHighPC(uint64_t LowPC) const { if (auto FormValue = find(DW_AT_high_pc)) { if (auto Address = FormValue->getAsAddress()) { |

