Skip to content

Commit fcf65ee

Browse files
committed
[Swift] lldb: Refactor uses of Function::GetAddressRange after its removal
See: llvm#132923 llvm#128515 llvm#125847
1 parent 250d993 commit fcf65ee

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
@@ -1176,8 +1176,7 @@ void SwiftLanguageRuntime::FindFunctionPointersInCall(
11761176
if (target_context.symbol)
11771177
fn_ptr_address = target_context.symbol->GetAddress();
11781178
else if (target_context.function)
1179-
fn_ptr_address =
1180-
target_context.function->GetAddressRange().GetBaseAddress();
1179+
fn_ptr_address = target_context.function->GetAddress();
11811180
}
11821181
}
11831182
}
@@ -2688,9 +2687,11 @@ DoesContinuationPointToSameFunction(addr_t async_reg, SymbolContext &sc,
26882687
Address continuation_addr;
26892688
continuation_addr.SetLoadAddress(process.FixCodeAddress(*continuation_ptr),
26902689
&process.GetTarget());
2691-
if (sc.function)
2692-
return sc.function->GetAddressRange().ContainsLoadAddress(
2693-
continuation_addr, &process.GetTarget());
2690+
if (sc.function) {
2691+
AddressRange unused_range;
2692+
return sc.function->GetRangeContainingLoadAddress(
2693+
continuation_addr.GetOffset(), process.GetTarget(), unused_range);
2694+
}
26942695
assert(sc.symbol);
26952696
return sc.symbol->ContainsFileAddress(continuation_addr.GetFileAddress());
26962697
}
@@ -2724,8 +2725,7 @@ static llvm::Expected<bool> IsIndirectContext(Process &process,
27242725
uint32_t prologue_size = sc.function ? sc.function->GetPrologueByteSize()
27252726
: sc.symbol->GetPrologueByteSize();
27262727
Address func_start_addr =
2727-
sc.function ? sc.function->GetAddressRange().GetBaseAddress()
2728-
: sc.symbol->GetAddress();
2728+
sc.function ? sc.function->GetAddress() : sc.symbol->GetAddress();
27292729
// Include one instruction after the prologue. This is where breakpoints
27302730
// by function name are set, so it's important to get this point right. This
27312731
// instruction is exactly at address "base + prologue", so adding 1
@@ -2776,7 +2776,7 @@ SwiftLanguageRuntime::GetRuntimeUnwindPlan(ProcessSP process_sp,
27762776
Address func_start_addr;
27772777
ConstString mangled_name;
27782778
if (sc.function) {
2779-
func_start_addr = sc.function->GetAddressRange().GetBaseAddress();
2779+
func_start_addr = sc.function->GetAddress();
27802780
mangled_name = sc.function->GetMangled().GetMangledName();
27812781
} else if (sc.symbol) {
27822782
func_start_addr = sc.symbol->GetAddress();

0 commit comments

Comments
 (0)