Skip to content

Commit b8afbae

Browse files
committed
[Swift] lldb: Refactor uses of Function::GetAddressRange after its removal
See: llvm#132923 llvm#128515 llvm#125847 (cherry picked from commit fcf65ee)
1 parent aab396b commit b8afbae

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,8 +1187,7 @@ void SwiftLanguageRuntime::FindFunctionPointersInCall(
11871187
if (target_context.symbol)
11881188
fn_ptr_address = target_context.symbol->GetAddress();
11891189
else if (target_context.function)
1190-
fn_ptr_address =
1191-
target_context.function->GetAddressRange().GetBaseAddress();
1190+
fn_ptr_address = target_context.function->GetAddress();
11921191
}
11931192
}
11941193
}
@@ -2700,9 +2699,11 @@ DoesContinuationPointToSameFunction(addr_t async_reg, SymbolContext &sc,
27002699
Address continuation_addr;
27012700
continuation_addr.SetLoadAddress(process.FixCodeAddress(*continuation_ptr),
27022701
&process.GetTarget());
2703-
if (sc.function)
2704-
return sc.function->GetAddressRange().ContainsLoadAddress(
2705-
continuation_addr, &process.GetTarget());
2702+
if (sc.function) {
2703+
AddressRange unused_range;
2704+
return sc.function->GetRangeContainingLoadAddress(
2705+
continuation_addr.GetOffset(), process.GetTarget(), unused_range);
2706+
}
27062707
assert(sc.symbol);
27072708
return sc.symbol->ContainsFileAddress(continuation_addr.GetFileAddress());
27082709
}
@@ -2736,8 +2737,7 @@ static llvm::Expected<bool> IsIndirectContext(Process &process,
27362737
uint32_t prologue_size = sc.function ? sc.function->GetPrologueByteSize()
27372738
: sc.symbol->GetPrologueByteSize();
27382739
Address func_start_addr =
2739-
sc.function ? sc.function->GetAddressRange().GetBaseAddress()
2740-
: sc.symbol->GetAddress();
2740+
sc.function ? sc.function->GetAddress() : sc.symbol->GetAddress();
27412741
// Include one instruction after the prologue. This is where breakpoints
27422742
// by function name are set, so it's important to get this point right. This
27432743
// instruction is exactly at address "base + prologue", so adding 1
@@ -2788,7 +2788,7 @@ SwiftLanguageRuntime::GetRuntimeUnwindPlan(ProcessSP process_sp,
27882788
Address func_start_addr;
27892789
ConstString mangled_name;
27902790
if (sc.function) {
2791-
func_start_addr = sc.function->GetAddressRange().GetBaseAddress();
2791+
func_start_addr = sc.function->GetAddress();
27922792
mangled_name = sc.function->GetMangled().GetMangledName();
27932793
} else if (sc.symbol) {
27942794
func_start_addr = sc.symbol->GetAddress();

0 commit comments

Comments
 (0)