Skip to content

IRGen: honour -static-libclosure in block creation #81754

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 1 commit into from
Jun 3, 2025

Conversation

compnerd
Copy link
Member

When creating a block, ensure that we correctly associate the DLL Storage on the _NSConcreteStackBlock root object declaration based upon whether we are generating code with -static-libclosure being passed to the clang importer or not.

@compnerd
Copy link
Member Author

@swift-ci please smoke test

@compnerd compnerd requested a review from aschwaighofer May 23, 2025 23:37
@compnerd
Copy link
Member Author

I'm not sure about the best way to handle the special casing needing for the runtime functions. On Windows, the code generation for libclosure is controlled through -static-libclosure. This set of changes honours that by checking the module that the runtime function originates from and if it is BlocksRuntime (the current spelling used in the Swift project) we treat it as local or not based upon the clang flag.

When creating a block, ensure that we correctly associate the DLL
Storage on the `_NSConcreteStackBlock` root object declaration based
upon whether we are generating code with `-static-libclosure` being
passed to the clang importer or not.
@compnerd
Copy link
Member Author

@swift-ci please smoke test

Copy link
Contributor

@aschwaighofer aschwaighofer left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me.

@compnerd compnerd merged commit 51645d0 into swiftlang:main Jun 3, 2025
3 checks passed
@compnerd compnerd deleted the closed branch June 3, 2025 15:35
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