Skip to content

Commit 50531f2

Browse files
authored
Merge pull request #79820 from compnerd/info
IRGen: compute locality for type declarations
2 parents aae0881 + dec54dd commit 50531f2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,6 +2397,11 @@ LinkInfo LinkInfo::get(const UniversalLinkageInfo &linkInfo,
23972397
// types to be referenced directly.
23982398
if (const auto *MD = entity.getSILFunction()->getParentModule())
23992399
isKnownLocal = MD == swiftModule || MD->isStaticLibrary();
2400+
} else if (entity.isTypeMetadataAccessFunction()) {
2401+
if (NominalTypeDecl *NTD = entity.getType()->getAnyNominal()) {
2402+
const ModuleDecl *MD = NTD->getDeclContext()->getParentModule();
2403+
isKnownLocal = MD == swiftModule || MD->isStaticLibrary();
2404+
}
24002405
}
24012406

24022407
bool weakImported = entity.isWeakImported(swiftModule);

0 commit comments

Comments
 (0)