Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix global accessor and class linker errors in package. #73686

Merged
merged 3 commits into from
May 22, 2024

Conversation

elsh
Copy link
Contributor

@elsh elsh commented May 16, 2024

When package resilience optimization is enabled, global accessor symbols are not added to the SIL symbol list, causing a linker issue.

Resolves rdar://127321129&127308331

@elsh
Copy link
Contributor Author

elsh commented May 16, 2024

@swift-ci smoke test

Copy link
Member

@slavapestov slavapestov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

lib/SIL/IR/SILSymbolVisitor.cpp Outdated Show resolved Hide resolved
@elsh elsh force-pushed the elsh/ir-global-accessor branch from 1fefb0d to c379f0a Compare May 16, 2024 23:30
@elsh
Copy link
Contributor Author

elsh commented May 16, 2024

@swift-ci smoke test

@elsh elsh enabled auto-merge May 16, 2024 23:32
@elsh elsh force-pushed the elsh/ir-global-accessor branch from c379f0a to 58cc800 Compare May 16, 2024 23:33
@elsh
Copy link
Contributor Author

elsh commented May 16, 2024

@swift-ci smoke test

@elsh elsh force-pushed the elsh/ir-global-accessor branch from 58cc800 to 34d9594 Compare May 17, 2024 18:40
@elsh elsh requested review from hborla and xedin as code owners May 17, 2024 18:40
@elsh
Copy link
Contributor Author

elsh commented May 17, 2024

@swift-ci smoke test

@elsh elsh force-pushed the elsh/ir-global-accessor branch from 97d5ef3 to c80f6c5 Compare May 17, 2024 19:18
@elsh elsh disabled auto-merge May 17, 2024 21:05
@elsh elsh force-pushed the elsh/ir-global-accessor branch from 9dfe9e3 to f83861e Compare May 20, 2024 21:37
Add global accessors to symbol list if VarDecl is fragile, i.e.
is non-resilient or its defining module allows non-resilient
access.

Don't set the class decl to hidden if it's in a package resilience
domain; even though its defining module is built resilently, the
class symbol should be visible across modules if they are in the
same package with resilience-bypass optimization. In such case,
treat its SubclassScope to Internal.

Resolves rdar://127321129
@elsh elsh force-pushed the elsh/ir-global-accessor branch from f83861e to 80855c8 Compare May 20, 2024 21:41
@elsh
Copy link
Contributor Author

elsh commented May 20, 2024

@swift-ci smoke test

@elsh elsh changed the title Fix global accessor linker error in package. Fix global accessor and class linker errors in package. May 21, 2024
@elsh
Copy link
Contributor Author

elsh commented May 21, 2024

@swift-ci smoke test

lib/SIL/IR/SILDeclRef.cpp Outdated Show resolved Hide resolved
lib/SIL/IR/SILDeclRef.cpp Outdated Show resolved Hide resolved
lib/Sema/TypeCheckStorage.cpp Outdated Show resolved Hide resolved
@elsh elsh force-pushed the elsh/ir-global-accessor branch from d72f92b to 36b4d2d Compare May 21, 2024 03:49
Add isStrictlyResilient() to nominal type and module decl.
@elsh
Copy link
Contributor Author

elsh commented May 22, 2024

@swift-ci smoke test

@elsh elsh merged commit c0720d5 into main May 22, 2024
3 checks passed
@elsh elsh deleted the elsh/ir-global-accessor branch May 22, 2024 05:59
@@ -5142,6 +5146,10 @@ bool NominalTypeDecl::isResilient() const {
return getModuleContext()->isResilient();
}

bool NominalTypeDecl::isStrictlyResilient() const {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: strict is vague when used as an API name. A better alternative could be something like isNonResilientAccessDisallowed()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants