Skip to content

[PackageCMO] Global var and accessor linkage should be kept private/hidden in SILGen. #74416

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

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

elsh
Copy link
Contributor

@elsh elsh commented Jun 14, 2024

This PR contains changes that ensure the following:

  • Global accessor linkage is kept hidden if its decl is resilient.
    • LinkageLimit::Never is returned for Global Accessor if its decl is resilient.
    • Since it's kept hidden, the use site should not expect a call to a global accessor if its static var decl being accessed is resilient. The bypassing resilience logic in AbstractStorageDecl::isResilient(ModuleDecl *, ResilienceExpansion) has been removed; to be addressed in Package CMO optimization pass.
  • sil_global linkage is kept private if its decl is resilient.

Resolves rdar://129829925

…idden in SILGen.

This PR contains changes that ensure the following:
* Global accessor linkage is kept hidden if its decl is resilient.
  - LinkageLimit::Never is returned for Global Accessor if its decl is resilient.
  - Since it's kept hidden, the use site should not expect a call to a global accessor
    if the static var decl being accessed is resilient. The bypassing resilience logic
    in AbstractStorageDecl::isResilient(accessingModule, decl) has been removed; to be
    addressed in Package CMO optimization pass.
* sil_global linkage is kept private if its decl is resilient.

Resolves rdar://129829925
@elsh elsh requested a review from aschwaighofer June 14, 2024 08:34
@elsh elsh force-pushed the elsh/pcmo-global branch from afa9e1d to 0a734c2 Compare June 14, 2024 08:36
@elsh
Copy link
Contributor Author

elsh commented Jun 14, 2024

@swift-ci test

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.

2 participants