[6.2 🍒] Modify clang declaration weakly-imported query to use Swift's code-gen target triple #81146
+85
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #81113
Explanation: Similarly to how #70564 configures 'ClangImporter's 'CodeGenerator' using Swift's compilation target triple, we must use the versioned version of the 'isWeakImported' query to determine linkage for imported Clang symbols. Otherwise we end up using the
clang-target
os version, which may not deem the symbol as requiring being weakly-linked, which means it may fail to resolve at link time.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: #81113
Reviewers: @cachemeifyoucan