35 if (!
data.isValidOffset(*offset_ptr))
37 "invalid range list offset 0x%" PRIx64, *offset_ptr);
39 AddressSize =
data.getAddressSize();
42 "range list at offset 0x%" PRIx64, *offset_ptr))
50 Entry.StartAddress =
data.getRelocatedAddress(offset_ptr);
52 data.getRelocatedAddress(offset_ptr, &Entry.SectionIndex);
55 if (*offset_ptr != prev_offset + 2 * AddressSize) {
58 "invalid range list entry at offset 0x%" PRIx64,
61 if (Entry.isEndOfListEntry())
63 Entries.push_back(Entry);
70 switch (AddressSize) {
72 AddrFmt =
"{0:x-8} {1:x-4} {2:x-4}\n";
75 AddrFmt =
"{0:x-8} {1:x-8} {2:x-8}\n";
78 AddrFmt =
"{0:x-8} {1:x-16} {2:x-16}\n";
84 OS <<
formatv(AddrFmt, Offset, RLE.StartAddress, RLE.EndAddress);
85 OS <<
formatv(
"{0:x-8} <End of list>\n", Offset);
89 std::optional<object::SectionedAddress> BaseAddr)
const {
95 if (RLE.isBaseAddressSelectionEntry(AddressSize)) {
96 BaseAddr = {RLE.EndAddress, RLE.SectionIndex};
101 E.
LowPC = RLE.StartAddress;
104 E.HighPC = RLE.EndAddress;
105 E.SectionIndex = RLE.SectionIndex;
112 E.LowPC += BaseAddr->Address;
113 E.HighPC += BaseAddr->Address;
114 if (E.SectionIndex == -1ULL)
115 E.SectionIndex = BaseAddr->SectionIndex;
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
LocallyHashedType DenseMapInfo< LocallyHashedType >::Tombstone
static Error checkAddressSizeSupported(unsigned AddressSize, std::error_code EC, char const *Fmt, const Ts &...Vals)
static bool isAddressSizeSupported(unsigned AddressSize)
LLVM_ABI Error extract(const DWARFDataExtractor &data, uint64_t *offset_ptr)
LLVM_ABI DWARFAddressRangesVector getAbsoluteRanges(std::optional< object::SectionedAddress > BaseAddr) const
getAbsoluteRanges - Returns absolute address ranges defined by this range list.
LLVM_ABI void dump(raw_ostream &OS) const
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
uint64_t computeTombstoneAddress(uint8_t AddressByteSize)
This is an optimization pass for GlobalISel generic memory operations.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
std::vector< DWARFAddressRange > DWARFAddressRangesVector
DWARFAddressRangesVector - represents a set of absolute address ranges.
uint64_t SectionIndex
A section index this range belongs to.
LLVM_ABI bool isBaseAddressSelectionEntry(uint8_t AddressSize) const
A base address selection entry consists of:
uint64_t StartAddress
A beginning address offset.