[PATCH] D70952: [DWARFDebugRnglists] Add a callback-based version of the getAbsoluteRanges function
Pavel Labath via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 4 01:40:02 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd34927e7dbcf: [DWARFDebugRnglists] Add a callback-based version of the getAbsoluteRanges… (authored by labath).
Changed prior to commit:
https://reviews.llvm.org/D70952?vs=231867&id=232054#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70952/new/
https://reviews.llvm.org/D70952
Files:
llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp
Index: llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFDebugRnglists.cpp
@@ -114,12 +114,21 @@
DWARFAddressRangesVector DWARFDebugRnglist::getAbsoluteRanges(
llvm::Optional<object::SectionedAddress> BaseAddr, DWARFUnit &U) const {
+ return getAbsoluteRanges(BaseAddr, [&](uint32_t Index) {
+ return U.getAddrOffsetSectionItem(Index);
+ });
+}
+
+DWARFAddressRangesVector DWARFDebugRnglist::getAbsoluteRanges(
+ Optional<object::SectionedAddress> BaseAddr,
+ function_ref<Optional<object::SectionedAddress>(uint32_t)>
+ LookupPooledAddress) const {
DWARFAddressRangesVector Res;
for (const RangeListEntry &RLE : Entries) {
if (RLE.EntryKind == dwarf::DW_RLE_end_of_list)
break;
if (RLE.EntryKind == dwarf::DW_RLE_base_addressx) {
- BaseAddr = U.getAddrOffsetSectionItem(RLE.Value0);
+ BaseAddr = LookupPooledAddress(RLE.Value0);
if (!BaseAddr)
BaseAddr = {RLE.Value0, -1ULL};
continue;
@@ -152,7 +161,7 @@
E.HighPC = E.LowPC + RLE.Value1;
break;
case dwarf::DW_RLE_startx_length: {
- auto Start = U.getAddrOffsetSectionItem(RLE.Value0);
+ auto Start = LookupPooledAddress(RLE.Value0);
if (!Start)
Start = {0, -1ULL};
E.SectionIndex = Start->SectionIndex;
Index: llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
===================================================================
--- llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
+++ llvm/include/llvm/DebugInfo/DWARF/DWARFDebugRnglists.h
@@ -47,6 +47,12 @@
public:
/// Build a DWARFAddressRangesVector from a rangelist.
DWARFAddressRangesVector
+ getAbsoluteRanges(Optional<object::SectionedAddress> BaseAddr,
+ function_ref<Optional<object::SectionedAddress>(uint32_t)>
+ LookupPooledAddress) const;
+
+ /// Build a DWARFAddressRangesVector from a rangelist.
+ DWARFAddressRangesVector
getAbsoluteRanges(llvm::Optional<object::SectionedAddress> BaseAddr,
DWARFUnit &U) const;
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70952.232054.patch
Type: text/x-patch
Size: 2209 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191204/6824eaca/attachment.bin>
More information about the llvm-commits
mailing list