This is a first cut at generating DWARF v5 range lists into the .debug_rnglists section. We are generating the range lists table specified by the standard, using the range list entry kinds DW_RLE_offset_pair and DW_RLE_start_length.
We do not support split DWARF yet, because as far as I can tell it requires support for .debug_addr to be able to refer back to locations in the executable.
Also, we don't yet use DW_FORM_rnglistx, so there is no offset table yet.
One of the modified test cases is fission-ranges.ll, which is a bit misleading as we don't support fission yet, but it already had a nice usable module, which avoids duplication.
It looks like this would end up adding a range list base address to the CU for every range emitted - wouldn't it?
Yeah, looks like it does:
using this input:
Compile with dwarf5 to LLVM IR, reorder the 3 calls to f1 (inserting the first call between the second and third) to cause the scope of 'b' to have a hole in the middle (for that first call to f1) & so to be described by a range list rather than high/low pc.
Looks like the range list base attribute should be added in the same place DW_AT_GNU_ranges_base is set, I think?