Skip to content

Commit 1fefb0d

Browse files
committed
Unconditionally add global vars
1 parent e3cce07 commit 1fefb0d

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

lib/SIL/IR/SILSymbolVisitor.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -599,18 +599,16 @@ class SILSymbolVisitorImpl : public ASTVisitor<SILSymbolVisitorImpl> {
599599
}
600600

601601
// 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 thus 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.
606+
if (VD->hasStorage() && isGlobalOrStaticVar(VD)) {
607+
if (!shouldSkipVisit(getDeclLinkage(VD))) {
608+
Visitor.addGlobalVar(VD);
613609
}
610+
if (VD->isLazilyInitializedGlobal())
611+
addFunction(SILDeclRef(VD, SILDeclRef::Kind::GlobalAccessor));
614612
}
615613

616614
visitAbstractStorageDecl(VD);

0 commit comments

Comments
 (0)