Skip to content

Commit

Permalink
Merge pull request swiftlang#79820 from compnerd/info
Browse files Browse the repository at this point in the history
IRGen: compute locality for type declarations
  • Loading branch information
compnerd authored Mar 8, 2025
2 parents aae0881 + dec54dd commit 50531f2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/IRGen/GenDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2397,6 +2397,11 @@ LinkInfo LinkInfo::get(const UniversalLinkageInfo &linkInfo,
// types to be referenced directly.
if (const auto *MD = entity.getSILFunction()->getParentModule())
isKnownLocal = MD == swiftModule || MD->isStaticLibrary();
} else if (entity.isTypeMetadataAccessFunction()) {
if (NominalTypeDecl *NTD = entity.getType()->getAnyNominal()) {
const ModuleDecl *MD = NTD->getDeclContext()->getParentModule();
isKnownLocal = MD == swiftModule || MD->isStaticLibrary();
}
}

bool weakImported = entity.isWeakImported(swiftModule);
Expand Down

0 comments on commit 50531f2

Please sign in to comment.