@@ -599,18 +599,18 @@ class SILSymbolVisitorImpl : public ASTVisitor<SILSymbolVisitorImpl> {
599
599
}
600
600
601
601
// Statically/globally stored variables have some special handling.
602
- // Global accessor gets no linkage limit in the same resilience domain,
603
- // e.g. in package with non-resilient access optimizations enabled,
604
- // so it should be added in such case.
605
- if (!VD->isResilient () ||
606
- VD->getModuleContext ()->allowNonResilientAccess ()) {
607
- if (VD->hasStorage () && isGlobalOrStaticVar (VD)) {
608
- if (!shouldSkipVisit (getDeclLinkage (VD))) {
609
- Visitor.addGlobalVar (VD);
610
- }
611
- if (VD->isLazilyInitializedGlobal ())
612
- addFunction (SILDeclRef (VD, SILDeclRef::Kind::GlobalAccessor));
602
+ // Global accessor should get no linkage limit and get non-hidden
603
+ // linkage in the same resilience domain, e.g. in the same package,
604
+ // so add them regardless of whether modules are built resiliently
605
+ // or not. If module is built resiliently without non-resilience
606
+ // package optimization, it gets a hidden linkage and gets ignored
607
+ // anyway, so there's no harm in doing so.
608
+ if (VD->hasStorage () && isGlobalOrStaticVar (VD)) {
609
+ if (!shouldSkipVisit (getDeclLinkage (VD))) {
610
+ Visitor.addGlobalVar (VD);
613
611
}
612
+ if (VD->isLazilyInitializedGlobal ())
613
+ addFunction (SILDeclRef (VD, SILDeclRef::Kind::GlobalAccessor));
614
614
}
615
615
616
616
visitAbstractStorageDecl (VD);
0 commit comments