Skip to content

Commit 1774208

Browse files
[lldb][swift][nfc] Move async register function into header
This will enable this function to be reused.
1 parent e6ebf2a commit 1774208

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2522,20 +2522,7 @@ void SwiftLanguageRuntime::DidFinishExecutingUserExpression(
25222522

25232523
bool SwiftLanguageRuntime::IsABIStable() { FORWARD(IsABIStable); }
25242524

2525-
namespace {
2526-
/// The target specific register numbers used for async unwinding.
2527-
///
2528-
/// For UnwindPlans, these use eh_frame / dwarf register numbering.
2529-
struct AsyncUnwindRegisterNumbers {
2530-
uint32_t async_ctx_regnum;
2531-
uint32_t fp_regnum;
2532-
uint32_t pc_regnum;
2533-
2534-
RegisterKind GetRegisterKind() const { return lldb::eRegisterKindDWARF; }
2535-
};
2536-
} // namespace
2537-
2538-
static std::optional<AsyncUnwindRegisterNumbers>
2525+
std::optional<AsyncUnwindRegisterNumbers>
25392526
GetAsyncUnwindRegisterNumbers(llvm::Triple::ArchType triple) {
25402527
switch (triple) {
25412528
case llvm::Triple::x86_64: {

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,21 @@ class SwiftLanguageRuntime : public LanguageRuntime {
517517
unsigned num_indirections = 0);
518518
};
519519

520+
/// The target specific register numbers used for async unwinding.
521+
///
522+
/// For UnwindPlans, these use eh_frame / dwarf register numbering.
523+
struct AsyncUnwindRegisterNumbers {
524+
uint32_t async_ctx_regnum;
525+
uint32_t fp_regnum;
526+
uint32_t pc_regnum;
527+
528+
/// All register numbers in this struct are given in the eRegisterKindDWARF
529+
/// domain.
530+
lldb::RegisterKind GetRegisterKind() const { return lldb::eRegisterKindDWARF; }
531+
};
532+
533+
std::optional<AsyncUnwindRegisterNumbers>
534+
GetAsyncUnwindRegisterNumbers(llvm::Triple::ArchType triple);
520535
} // namespace lldb_private
521536

522537
#endif // liblldb_SwiftLanguageRuntime_h_

0 commit comments

Comments
 (0)