summaryrefslogtreecommitdiff
path: root/rust
diff options
context:
space:
mode:
authorMark Rowe <mark@vector35.com>2026-02-18 23:41:11 -0800
committerMark Rowe <mark@vector35.com>2026-03-23 16:08:45 -0700
commit3feaf74969b5d855993842e204cab04fb9725165 (patch)
tree5edac688948c2c465f27d3a795bd17cac76c4bd3 /rust
parent1fb9828d1e12f242fa6a53aa43603ae5e556b69d (diff)
[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.
Diffstat (limited to 'rust')
-rw-r--r--rust/src/architecture.rs14
1 files changed, 14 insertions, 0 deletions
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<Ref<CoreCallingConvention>> {
+ 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<CoreCallingConvention> {
unsafe {
let mut count = 0;