@@ -2952,15 +2952,13 @@ bool Decl::isOutermostPrivateOrFilePrivateScope() const {
29522952 !isInPrivateOrLocalContext (this );
29532953}
29542954
2955- bool AbstractStorageDecl::isFormallyResilient () const {
2955+ bool AbstractStorageDecl::isResilient () const {
29562956 // Check for an explicit @_fixed_layout attribute.
29572957 if (getAttrs ().hasAttribute <FixedLayoutAttr>())
29582958 return false ;
29592959
2960- // If we're an instance property of a nominal type, query the type.
2961- auto *dc = getDeclContext ();
29622960 if (!isStatic ())
2963- if (auto *nominalDecl = dc ->getSelfNominalTypeDecl ())
2961+ if (auto *nominalDecl = getDeclContext () ->getSelfNominalTypeDecl ())
29642962 return nominalDecl->isResilient ();
29652963
29662964 // Non-public global and static variables always have a
@@ -2969,19 +2967,14 @@ bool AbstractStorageDecl::isFormallyResilient() const {
29692967 /* treatUsableFromInlineAsPublic=*/ true ).isPublicOrPackage ())
29702968 return false ;
29712969
2972- return true ;
2973- }
2974-
2975- bool AbstractStorageDecl::isResilient () const {
2976- if (!isFormallyResilient ())
2977- return false ;
29782970 if (!getModuleContext ()->isResilient ())
29792971 return false ;
2972+
29802973 // Allows bypassing resilience checks for package decls
29812974 // at use site within a package if opted in, whether the
29822975 // loaded module was built resiliently or not.
2983- return !getDeclContext ()->allowBypassResilienceInPackage (getFormalAccessScope (/* useDC=*/ nullptr ,
2984- /* treatUsableFromInlineAsPublic=*/ true ).isPackage ());
2976+ return !getDeclContext ()->bypassResilienceInPackage (getFormalAccessScope (/* useDC=*/ nullptr ,
2977+ /* treatUsableFromInlineAsPublic=*/ true ).isPackage ());
29852978}
29862979
29872980bool AbstractStorageDecl::isResilient (ModuleDecl *M,
@@ -5057,8 +5050,8 @@ bool NominalTypeDecl::isResilient() const {
50575050 // Allows bypassing resilience checks for package decls
50585051 // at use site within a package if opted in, whether the
50595052 // loaded module was built resiliently or not.
5060- return !getDeclContext ()->allowBypassResilienceInPackage (getFormalAccessScope (/* useDC=*/ nullptr ,
5061- /* treatUsableFromInlineAsPublic=*/ true ).isPackage ());
5053+ return !getDeclContext ()->bypassResilienceInPackage (getFormalAccessScope (/* useDC=*/ nullptr ,
5054+ /* treatUsableFromInlineAsPublic=*/ true ).isPackage ());
50625055}
50635056
50645057DestructorDecl *NominalTypeDecl::getValueTypeDestructor () {
@@ -6382,7 +6375,7 @@ bool EnumDecl::isFormallyExhaustive(const DeclContext *useDC) const {
63826375 // package enum is optimized with bypassing resilience checks.
63836376 if (!accessScope.isPublicOrPackage ())
63846377 return true ;
6385- if (useDC && useDC->allowBypassResilienceInPackage (accessScope.isPackage ()))
6378+ if (useDC && useDC->bypassResilienceInPackage (accessScope.isPackage ()))
63866379 return true ;
63876380
63886381 // All other checks are use-site specific; with no further information, the
0 commit comments