Skip to content

Conversation

@krodak
Copy link
Member

@krodak krodak commented Dec 24, 2025

Overview

This PR extracts some codegen code from ExportSwift, as it became a bit large due to new types introduction. Some additional minor cleanup introduced along the way.

Technical changes

  • extracted specialized code generators into ExportSwiftCodegens.swift with updated and a bit more consistent naming
  • added protocols codegen
  • unified thunk body rendering (renderFunctionBody(into:returnExpr:) helper)
  • shared property rendering for instance and static ones
  • removed some unused parameters

Testing

I've fixed testing regression I've introduced here when I was trying to run some tests on macOS with Swift 6.2.1 and disabled async tests, sorry for that 🙇🏻 🙏🏻

@krodak krodak self-assigned this Dec 24, 2025
Copy link
Member

@kateinoigakukun kateinoigakukun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently SwiftPM has a performance issue that slows down the plugin compilation scaling on the number of source files. I just made a fix in SwiftPM side (swiftlang/swift-package-manager#9541) but I'm a bit hesitant to introduce a new separate file here. Would you mind merging the new file into an existing file for now?

@krodak krodak force-pushed the chore/codegen-cleanup branch from 5d4a0a2 to 5a5d89b Compare December 24, 2025 14:08
@krodak krodak force-pushed the chore/codegen-cleanup branch from 5a5d89b to 6f4b5b2 Compare December 24, 2025 14:10
Copy link
Member

@kateinoigakukun kateinoigakukun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@krodak krodak merged commit 7704862 into swiftwasm:main Dec 24, 2025
10 checks passed
@krodak krodak deleted the chore/codegen-cleanup branch December 24, 2025 16:59
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.

2 participants