Modify clang declaration weakly-imported query to use Swift's code-gen target triple

Similarly to how https://github.com/swiftlang/swift/pull/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.
This commit is contained in:
Artem Chikin
2025-04-25 16:51:42 -07:00
parent ee6deccd76
commit fe632e530f
4 changed files with 85 additions and 6 deletions

View File

@@ -618,7 +618,8 @@ bool SILFunction::isWeakImported(ModuleDecl *module) const {
// For imported functions check the Clang declaration.
if (ClangNodeOwner)
return ClangNodeOwner->getClangDecl()->isWeakImported();
return ClangNodeOwner->getClangDecl()->isWeakImported(
getASTContext().LangOpts.getMinPlatformVersion());
// For native functions check a flag on the SILFunction
// itself.