From 3feaf74969b5d855993842e204cab04fb9725165 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Wed, 18 Feb 2026 23:41:11 -0800 Subject: [Swift] Add arm64 calling conventions The Swift ABI repurposes three callee-saved registers for implicit parameters (self, error, and async context). Supporting the various combinations of these requires registering several different calling conventions. The demangler is taught to explicitly apply these calling conventions to functions that need them. --- rust/src/architecture.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'rust') diff --git a/rust/src/architecture.rs b/rust/src/architecture.rs index 6b644e88..e854d53b 100644 --- a/rust/src/architecture.rs +++ b/rust/src/architecture.rs @@ -1262,6 +1262,20 @@ pub trait ArchitectureExt: Architecture { } } + fn calling_convention_by_name(&self, name: &str) -> Option> { + let name = name.to_cstr(); + unsafe { + let result = NonNull::new(BNGetArchitectureCallingConventionByName( + self.as_ref().handle, + name.as_ptr(), + ))?; + Some(CoreCallingConvention::ref_from_raw( + result.as_ptr(), + self.as_ref().handle(), + )) + } + } + fn calling_conventions(&self) -> Array { unsafe { let mut count = 0; -- cgit v1.3.1