[Lldb-commits] [lldb] [lldb] Reimplement LineTable::FindLineEntryByAddress on top of lower_bound (PR #127799)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Thu Feb 27 00:56:26 PST 2025
labath wrote:
I'm not sure what to think about that. The principal "result" of this function is the `LineEntry` object (most of the call sites don't even use the index), so the functional programmer in me wants to make this return an `optional<LineEntry>`. However, that doesn't sit very well with the code currently calling that function (because they are usually filling in the field directly in the SymbolContext). And `optional<uint_32_t>` behaves very much like `bool` if you're not interested in the actual index value -- which is nice, but then that wouldn't be very consistent with the other functions which return UINT32_MAX as a "not found" value.
If, after reading this, you still think this is a good idea, let me know, and I'll whip up a patch.
https://github.com/llvm/llvm-project/pull/127799
More information about the lldb-commits
mailing list