Skip to content

Commit 6a412e4

Browse files
authored
[lldb] Restore Swift IsSymbolARuntimeThunk override (#2917)
The swift override of `IsSymbolARuntimeThunk` was unintentionally removed in #536. This restores it. rdar://65681037
1 parent d53fe9e commit 6a412e4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ class SwiftLanguageRuntime : public LanguageRuntime {
123123

124124
void ModulesDidLoad(const ModuleList &module_list) override;
125125

126+
bool IsSymbolARuntimeThunk(const Symbol &symbol) override;
127+
126128
/// Mangling support.
127129
/// \{
128130
/// Use these passthrough functions rather than calling into Swift directly,

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,15 @@ static lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread,
596596
return new_thread_plan_sp;
597597
}
598598

599+
bool SwiftLanguageRuntime::IsSymbolARuntimeThunk(const Symbol &symbol) {
600+
llvm::StringRef symbol_name =
601+
symbol.GetMangled().GetMangledName().GetStringRef();
602+
if (symbol_name.empty())
603+
return false;
604+
swift::Demangle::Context demangle_ctx;
605+
return demangle_ctx.isThunkSymbol(symbol_name);
606+
}
607+
599608
bool SwiftLanguageRuntime::IsSwiftMangledName(llvm::StringRef name) {
600609
return swift::Demangle::isSwiftSymbol(name);
601610
}

0 commit comments

Comments
 (0)