Skip to content

embedded: make sure to generate witness tables which are imported from other modules #78555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

eeckstein
Copy link
Contributor

@eeckstein eeckstein commented Jan 10, 2025

In embedded swift all the code is generated in the top-level module. De-serialized tables must be code-gen'd and therefore made non-external.

This also requires another change: in IRGen, don't force generate code for functions which are imported from other modules.

Only generate code lazily for such functions, i.e. only if such a function is referenced from already generated code.
This is achieved by converting the SILLinkage for public_external functions to internal instead of public in IRGenPrepare.

Fixes an unresolved symbol linker error.
rdar://142561676

@eeckstein eeckstein requested a review from jckarter as a code owner January 10, 2025 18:51
@eeckstein eeckstein requested a review from kubamracek January 10, 2025 18:51
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@kubamracek
Copy link
Contributor

Nice, thanks!

…m other modules

In embedded swift all the code is generated in the top-level module.
De-serialized witness tables for class existentials must be code-gen'd and therefore made non-external.

Fixes an unresolved symbol linker error.
rdar://142561676
… imported from other modules.

Only generate code lazily for such functions, i.e. only if such a function is referenced from already generated code.
This is achieved by converting the SILLinkage for `public_external` functions to `internal` instead of `public in IRGenPrepare.
@eeckstein eeckstein force-pushed the witness-table-linkage branch from 7432d9d to 9d0fc8b Compare January 13, 2025 13:09
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

@eeckstein
Copy link
Contributor Author

@swift-ci benchmark

@eeckstein eeckstein merged commit ff7c331 into swiftlang:main Jan 14, 2025
3 of 4 checks passed
@eeckstein eeckstein deleted the witness-table-linkage branch January 14, 2025 07:12
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