@@ -2952,15 +2952,13 @@ bool Decl::isOutermostPrivateOrFilePrivateScope() const {
2952
2952
!isInPrivateOrLocalContext (this );
2953
2953
}
2954
2954
2955
- bool AbstractStorageDecl::isFormallyResilient () const {
2955
+ bool AbstractStorageDecl::isResilient () const {
2956
2956
// Check for an explicit @_fixed_layout attribute.
2957
2957
if (getAttrs ().hasAttribute <FixedLayoutAttr>())
2958
2958
return false ;
2959
2959
2960
- // If we're an instance property of a nominal type, query the type.
2961
- auto *dc = getDeclContext ();
2962
2960
if (!isStatic ())
2963
- if (auto *nominalDecl = dc ->getSelfNominalTypeDecl ())
2961
+ if (auto *nominalDecl = getDeclContext () ->getSelfNominalTypeDecl ())
2964
2962
return nominalDecl->isResilient ();
2965
2963
2966
2964
// Non-public global and static variables always have a
@@ -2969,19 +2967,14 @@ bool AbstractStorageDecl::isFormallyResilient() const {
2969
2967
/* treatUsableFromInlineAsPublic=*/ true ).isPublicOrPackage ())
2970
2968
return false ;
2971
2969
2972
- return true ;
2973
- }
2974
-
2975
- bool AbstractStorageDecl::isResilient () const {
2976
- if (!isFormallyResilient ())
2977
- return false ;
2978
2970
if (!getModuleContext ()->isResilient ())
2979
2971
return false ;
2972
+
2980
2973
// Allows bypassing resilience checks for package decls
2981
2974
// at use site within a package if opted in, whether the
2982
2975
// 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 ());
2985
2978
}
2986
2979
2987
2980
bool AbstractStorageDecl::isResilient (ModuleDecl *M,
@@ -5057,8 +5050,8 @@ bool NominalTypeDecl::isResilient() const {
5057
5050
// Allows bypassing resilience checks for package decls
5058
5051
// at use site within a package if opted in, whether the
5059
5052
// 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 ());
5062
5055
}
5063
5056
5064
5057
DestructorDecl *NominalTypeDecl::getValueTypeDestructor () {
@@ -6382,7 +6375,7 @@ bool EnumDecl::isFormallyExhaustive(const DeclContext *useDC) const {
6382
6375
// package enum is optimized with bypassing resilience checks.
6383
6376
if (!accessScope.isPublicOrPackage ())
6384
6377
return true ;
6385
- if (useDC && useDC->allowBypassResilienceInPackage (accessScope.isPackage ()))
6378
+ if (useDC && useDC->bypassResilienceInPackage (accessScope.isPackage ()))
6386
6379
return true ;
6387
6380
6388
6381
// All other checks are use-site specific; with no further information, the
0 commit comments