-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Open
Description
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