Skip to content

Conversation

artemcm
Copy link

@artemcm artemcm commented Apr 25, 2025

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
Copy link
Author

artemcm commented Apr 25, 2025

swiftlang/swift#81113
@swift-ci test

Copy link

@cachemeifyoucan cachemeifyoucan left a comment

Choose a reason for hiding this comment

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

LGTM. This is clean enough to go upstream (maybe with other availability downstream changes).

Don't forget next branch.

@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-Stable branch from e6a4b7d to 34b18ab Compare April 29, 2025 16:55
@artemcm
Copy link
Author

artemcm commented Apr 29, 2025

@swift-ci test

@artemcm
Copy link
Author

artemcm commented Apr 30, 2025

@swift-ci test macOS platform

@artemcm artemcm merged commit d8c95f5 into stable/20240723 May 5, 2025
2 checks passed
@artemcm artemcm deleted the ParameterizeWeakQueryForSwift-Stable branch May 5, 2025 16:21
artemcm added a commit to artemcm/llvm-project that referenced this pull request Jul 15, 2025
…computation

A previous change (swiftlang#10555) added support for querying 'isWeakImported' to be parameterized on the enclosing target version to match 'CheckAvailability' and 'getAvailability'. We missed passing in this parameter in the Clang module code-gen when querying linkage for a global variable. This change adds the missing parameter and removes the default parameter from the query in order to avoid this kind of bug in the future.

Resolves rdar://154677999
artemcm added a commit to artemcm/llvm-project that referenced this pull request Jul 15, 2025
…computation

A previous change (swiftlang#10555) added support for querying 'isWeakImported' to be parameterized on the enclosing target version to match 'CheckAvailability' and 'getAvailability'. We missed passing in this parameter in the Clang module code-gen when querying linkage for a global variable. This change adds the missing parameter and removes the default parameter from the query in order to avoid this kind of bug in the future.

Resolves rdar://154677999
artemcm added a commit that referenced this pull request Jul 17, 2025
…computation

A previous change (#10555) added support for querying 'isWeakImported' to be parameterized on the enclosing target version to match 'CheckAvailability' and 'getAvailability'. We missed passing in this parameter in the Clang module code-gen when querying linkage for a global variable. This change adds the missing parameter and removes the default parameter from the query in order to avoid this kind of bug in the future.

Resolves rdar://154677999
cyndyishida pushed a commit that referenced this pull request Jul 17, 2025
…computation

A previous change (#10555) added support for querying 'isWeakImported' to be parameterized on the enclosing target version to match 'CheckAvailability' and 'getAvailability'. We missed passing in this parameter in the Clang module code-gen when querying linkage for a global variable. This change adds the missing parameter and removes the default parameter from the query in order to avoid this kind of bug in the future.

Resolves rdar://154677999
AnthonyLatsis pushed a commit that referenced this pull request Jul 29, 2025
…computation

A previous change (#10555) added support for querying 'isWeakImported' to be parameterized on the enclosing target version to match 'CheckAvailability' and 'getAvailability'. We missed passing in this parameter in the Clang module code-gen when querying linkage for a global variable. This change adds the missing parameter and removes the default parameter from the query in order to avoid this kind of bug in the future.

Resolves rdar://154677999

(cherry picked from commit 69d0b90.)
This change barely missed the `stable/21.x` cutoff; we only just
realized we're missing it.)
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