Skip to content

[clr-ios] Implement Swift calling convention in CoreCLR interpreter #120049

@kotlarmilos

Description

@kotlarmilos

Description

Add Swift calling convention support to callstubgenerator.cpp. This includes implementing Swift-specific argument passing (registers vs. stack), wiring the call stub to the existing lowering algorithm, and correctly handling indirect result and error registers as defined by the platform Swift ABI. The goal is to generate correct call stubs for Swift functions so that CoreCLR can interoperate without relying on ad-hoc shims.

Tasks

  • Recognize the Swift calling convention in the stub generator (e.g., CorInfoCallConvExtension::Swift).
  • Implement Swift-ABI argument register vs. stack placement per platform ABI
  • Detect when the result is returned indirectly and marshal the hidden result pointer per Swift ABI
  • Support Swift “error result” and propagate failure back to the managed caller appropriately
  • Invoke the existing lowering algorithm for value types
  • Run on Apple targets (iOS/tvOS/MacCatalyst) with interpreter-enabled runtime

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions