@@ -31,16 +31,6 @@ namespace lldb_private {
31
31
static const char *g_dollar_tau_underscore = u8" $\u03C4 _" ;
32
32
static const char *g_tau_underscore = g_dollar_tau_underscore + 1 ;
33
33
34
- static bool IsSymbolARuntimeThunk (const Symbol &symbol) {
35
- llvm::StringRef symbol_name =
36
- symbol.GetMangled ().GetMangledName ().GetStringRef ();
37
- if (symbol_name.empty ())
38
- return false ;
39
-
40
- swift::Demangle::Context demangle_ctx;
41
- return demangle_ctx.isThunkSymbol (symbol_name);
42
- }
43
-
44
34
namespace {
45
35
46
36
enum class ThunkKind {
@@ -61,7 +51,9 @@ enum class ThunkAction {
61
51
62
52
} // namespace
63
53
64
- static ThunkKind GetThunkKind (llvm::StringRef symbol_name) {
54
+ static ThunkKind GetThunkKind (Symbol *symbol) {
55
+ auto symbol_name = symbol->GetMangled ().GetMangledName ().GetStringRef ();
56
+
65
57
swift::Demangle::Node::Kind kind;
66
58
swift::Demangle::Context demangle_ctx;
67
59
if (!demangle_ctx.isThunkSymbol (symbol_name))
@@ -161,10 +153,7 @@ static lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread,
161
153
SymbolContext sc = stack_sp->GetSymbolContext (eSymbolContextEverything);
162
154
Symbol *symbol = sc.symbol ;
163
155
164
- // Note, I don't really need to consult IsSymbolARuntimeThunk here,
165
- // but it is fast to do and keeps this list and the one in
166
- // IsSymbolARuntimeThunk in sync.
167
- if (!symbol || !IsSymbolARuntimeThunk (*symbol))
156
+ if (!symbol)
168
157
return new_thread_plan_sp;
169
158
170
159
// Only do this if you are at the beginning of the thunk function:
@@ -176,10 +165,9 @@ static lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread,
176
165
return new_thread_plan_sp;
177
166
178
167
Address target_address;
179
- ConstString symbol_mangled_name = symbol->GetMangled ().GetMangledName ();
180
- const char *symbol_name = symbol_mangled_name.AsCString ();
168
+ const char *symbol_name = symbol->GetMangled ().GetMangledName ().AsCString ();
181
169
182
- ThunkKind thunk_kind = GetThunkKind (symbol_mangled_name. GetStringRef () );
170
+ ThunkKind thunk_kind = GetThunkKind (symbol );
183
171
ThunkAction thunk_action = GetThunkAction (thunk_kind);
184
172
185
173
switch (thunk_action) {
@@ -225,7 +213,7 @@ static lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread,
225
213
// with that function name.
226
214
swift::Demangle::Context demangle_ctx;
227
215
swift::Demangle::NodePointer demangled_nodes =
228
- demangle_ctx.demangleSymbolAsNode (symbol_mangled_name. GetStringRef () );
216
+ demangle_ctx.demangleSymbolAsNode (symbol_name );
229
217
230
218
// Now find the ProtocolWitness node in the demangled result.
231
219
0 commit comments