Skip to content

[Swift] Add initial support for Swift demangling#8024

Open
bdash wants to merge 4 commits intodevfrom
test_swift_demangling
Open

[Swift] Add initial support for Swift demangling#8024
bdash wants to merge 4 commits intodevfrom
test_swift_demangling

Conversation

@bdash
Copy link
Contributor

@bdash bdash commented Mar 20, 2026

This adds:

  1. A new plug-in for Swift-specific analysis.
  2. Basic demangling, where symbols have a demangled name assigned to them.
  3. Support for applying parameter and return types to functions during demangling. This is behind a disabled by default setting at present, as we are currently not able to represent parameters that are small structs being passed across multiple registers. As a result, applying type information can be more confusing than not having it at all.
  4. Swift calling conventions for arm64. 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.

To be done in the future:

  1. Apply parameter and return types to thunks, metadata accessors, and all of the other nonsense Swift supports.
  2. Swift calling conventions for x86_64.

Fixes #7211 and initial work towards #3914.

bdash added 4 commits March 19, 2026 17:12
…mangling

This is disabled by default due to a current limitation where core is
not able to represent parameters that are small structs being passed
across multiple registers. `analysis.swift.extractTypesFromMangledNames`
can be enabled to test this.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

swift demangling

1 participant