Skip to content

[6.2 🍒][clang] Allow parameterized 'isWeakImport' based on an enclosing platform version #10568

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
May 5, 2025

Conversation

artemcm
Copy link

@artemcm artemcm commented Apr 28, 2025

Cherry-pick of #10555

Explanation: Similarly to 'CheckAvailability' and 'getAvailability', set 'Decl::isWeakImported' to allow querying using an external target platform version.

In #7916 we have added support for configuring 'clang::CodeGenerator' with a differently-versioned target info, and this change adopts the code generator's target info in order to also determine weakly-imported linkage on declarations during code-gen. Before this change, they were relying on the 'ASTContext' to specify the target info, which may differ from code-gen's.

Issue: rdar://134820348

Risk: Low, this change causes determination of whether a Clang symbol is weakly-linked to start utilizing the correct target triple, instead of relying on the SDK type-checking os version triple. This should not affect symbols which were not supposed to be deemed as weakly-imported before and will cause the ones that were to behave correctly.

Testing: Added tests to test suite

Original PRs: #10555

Reviewers: @cachemeifyoucan

@artemcm artemcm requested a review from a team as a code owner April 28, 2025 19:18
@artemcm
Copy link
Author

artemcm commented Apr 28, 2025

@swift-ci test

@artemcm
Copy link
Author

artemcm commented Apr 29, 2025

@swift-ci test macOS platform

…form version

Similarly to 'CheckAvailability' and 'getAvailability', set 'Decl::isWeakImported' to allow querying using an external target platform version.

In #7916 we have added support for configuring 'clang::CodeGenerator' with a differently-versioned target info, and this change adopts the code generator's target info in order to also determine weakly-imported linkage on declarations during code-gen. Before this change, they were relying on the 'ASTContext' to specify the target info, which may differ from code-gen's.
@artemcm artemcm force-pushed the ParameterizeWeakQueryForSwift-62 branch from 833d094 to bdb2353 Compare April 29, 2025 16:57
@artemcm
Copy link
Author

artemcm commented Apr 29, 2025

@swift-ci test

@artemcm artemcm requested a review from nkcsgexi May 5, 2025 16:13
@akyrtzi akyrtzi merged commit 6f7787b into swift/release/6.2 May 5, 2025
3 checks passed
@akyrtzi akyrtzi deleted the ParameterizeWeakQueryForSwift-62 branch May 5, 2025 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants