Skip to content

Commit 3462165

Browse files
Make file_range optional in DWARFExpressionEntry for always-valid expr
1 parent 60898ea commit 3462165

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lldb/include/lldb/Expression/DWARFExpressionList.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class DWARFExpressionList {
6363
/// Represents an entry in the DWARFExpressionList with all needed metadata.
6464
struct DWARFExpressionEntry {
6565
/// Represents a DWARF location range in the DWARF unit’s file‐address space
66-
AddressRange file_range;
66+
std::optional<AddressRange> file_range; ///< None = always-valid single expr
6767
const DWARFExpression *expr;
6868
};
6969

lldb/source/Expression/DWARFExpressionList.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ std::optional<DWARFExpressionList::DWARFExpressionEntry>
5858
DWARFExpressionList::GetExpressionEntryAtAddress(lldb::addr_t func_load_addr,
5959
lldb::addr_t load_addr) const {
6060
if (const DWARFExpression *always = GetAlwaysValidExpr()) {
61-
AddressRange full_range(m_func_file_addr, /*size=*/LLDB_INVALID_ADDRESS);
62-
return DWARFExpressionEntry{full_range, always};
61+
return DWARFExpressionEntry{std::nullopt, always};
6362
}
6463

6564
if (func_load_addr == LLDB_INVALID_ADDRESS)

0 commit comments

Comments
 (0)