Skip to content

Commit c8aadde

Browse files
[lldb][nfc] Create overload for IsAnySwiftAsyncFunctionSymbol
This will enable reuse of this function in a subsequent commit.
1 parent 44566d7 commit c8aadde

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ class SwiftLanguageRuntime : public LanguageRuntime {
139139
/// function, or suspend resume partial function symbol.
140140
static bool IsAnySwiftAsyncFunctionSymbol(llvm::StringRef name);
141141

142+
/// Return true if node is a Swift async function, await resume partial
143+
/// function, or suspend resume partial function symbol.
144+
static bool IsAnySwiftAsyncFunctionSymbol(NodePointer node);
145+
142146
/// Return the async context address using the target's specific register.
143147
static lldb::addr_t GetAsyncContext(RegisterContext *regctx);
144148

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ bool SwiftLanguageRuntime::IsAnySwiftAsyncFunctionSymbol(StringRef name) {
130130
using namespace swift::Demangle;
131131
Context ctx;
132132
NodePointer node = SwiftLanguageRuntime::DemangleSymbolAsNode(name, ctx);
133+
return IsAnySwiftAsyncFunctionSymbol(node);
134+
}
135+
136+
bool SwiftLanguageRuntime::IsAnySwiftAsyncFunctionSymbol(NodePointer node) {
133137
if (!node || node->getKind() != Node::Kind::Global || !node->getNumChildren())
134138
return false;
135139
auto marker = node->getFirstChild()->getKind();

0 commit comments

Comments
 (0)