-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Move in-package resilience bypassing logic to a resilience check with accessing module #71663
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
Conversation
isResilient(ModuleDecl, ResilienceExpansion). isResilient() returns the decl's resilience by definition and should not be altered whether bypassing optimization is enabled or not. The overloaded isResilient(ModuleDecl..) is used for accessing a decl from a client module, which is the appropriate place to opt in for non-resilience in package. Resolves rdar://123031292
@swift-ci smoke test |
…-bypass-resilience
@swift-ci smoke test |
@swift-ci smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
getModuleContext()->inSamePackage(accessingModule) && | ||
!getModuleContext()->isBuiltFromInterface() && | ||
getFormalAccessScope(/*useDC=*/nullptr, | ||
/*treatUsableFromInlineAsPublic=*/true).isPackage(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you don't need the isPackage() check -- it should be safe to access public decls non-resiliently too across a package boundary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll push a separate PR for that.
isResilient() returns the decl's resilience by definition and should not be altered whether resilience bypassing optimization is enabled or not. The overloaded isResilient(ModuleDecl, ResilienceExpansion) is used for accessing a decl from a client module, which is the appropriate place to check for in-package resilience bypass optimization.
Resolves rdar://123031292