Skip to content

[SILGen] Unified Entry Point Emission #67747

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 8 commits into from
Aug 8, 2023

Conversation

zachary-kent
Copy link
Contributor

@zachary-kent zachary-kent commented Aug 4, 2023

This PR implements unified entry point emission in SILGen so that all top level code is emitted at once. Although this is arguably NFC, I had to modify some tests because all declarations referenced by top-level code are now emitted first during SILGen.

@zachary-kent
Copy link
Contributor Author

@swift-ci please test


namespace Lowering {

/// Generates a `SILFunction` for toplevel code
Copy link
Contributor

Choose a reason for hiding this comment

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

A bit more detail would be nice; script mode, TopLevelCodeDecl, global variable initializers, etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, thanks! Does it look better now?

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

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

Awesome!

@zachary-kent
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

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

This is a nice refactoring, thank you!

@slavapestov
Copy link
Contributor

@swift-ci Please test source compatibility

@zachary-kent
Copy link
Contributor Author

@swift-ci Please test source compatibility

@zachary-kent
Copy link
Contributor Author

@swift-ci please test

@zachary-kent
Copy link
Contributor Author

@swift-ci please test

@zachary-kent
Copy link
Contributor Author

@swift-ci please test

@zachary-kent zachary-kent merged commit d240ffa into swiftlang:main Aug 8, 2023
@zachary-kent zachary-kent deleted the sil-gen-top-level branch August 8, 2023 23:14
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.

3 participants