[llvm] Improve DWARFDebugLine::LineTable::lookupAddressRangeImpl(...) to act as exptected. (PR #226625)
Peter Rong via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 26 10:26:51 PDT 2026
DataCorrupted wrote:
Overall LGTM except for nits. I wish we can change the title: "Improve" and "as exptected" is unclear. IIUC the documentation of `lookupAddressRangeImpl` didn't explicitly say whether the "expected" return value should contain Rows with identical address ranges (because when the function is written `SttmSequenceOffset` and ICF wasn't a thing yet). So I'd recommend we change that as well:
```cpp
/// Fills the Result argument with the indices of the rows that correspond
/// to the address range specified by \p Address and \p Size.
///
/// \param Address - The starting address of the range.
/// \param Size - The size of the address range.
/// \param Result - The vector to fill with row indices.
/// \param StmtSequenceOffset - if provided, only rows from the sequence
/// starting at the matching offset will be added to the result.
///
/// Returns true if any rows were found.
bool
lookupAddressRangeImpl(object::SectionedAddress Address, uint64_t Size,
std::vector<uint32_t> &Result,
std::optional<uint64_t> StmtSequenceOffset) const;
```
```
/// \param Result - The vector to fill with row indices that has _unique_ ranges, duplicated ranges will be discarded (because of XYZ)
```
And the title could be "[DWARF] Update `lookupAddressRangeImpl` so the `Result` only contains unique ranges"
https://github.com/llvm/llvm-project/pull/226625
More information about the llvm-commits
mailing list