@@ -2810,26 +2810,13 @@ bool AbstractStorageDecl::isResilient() const {
2810
2810
return getModuleContext ()->isResilient ();
2811
2811
}
2812
2812
2813
- static bool isOriginallyDefinedIn (const Decl *D, const ModuleDecl* MD) {
2814
- if (!MD)
2815
- return false ;
2816
- if (D->getAlternateModuleName ().empty ())
2817
- return false ;
2818
- return D->getAlternateModuleName () == MD->getName ().str ();
2819
- }
2820
-
2821
2813
bool AbstractStorageDecl::isResilient (ModuleDecl *M,
2822
2814
ResilienceExpansion expansion) const {
2823
2815
switch (expansion) {
2824
2816
case ResilienceExpansion::Minimal:
2825
2817
return isResilient ();
2826
2818
case ResilienceExpansion::Maximal:
2827
- // We consider this decl belongs to the module either it's currently
2828
- // defined in this module or it's originally defined in this module, which
2829
- // is specified by @_originallyDefinedIn
2830
- return (M != getModuleContext () &&
2831
- !isOriginallyDefinedIn (this , M) &&
2832
- isResilient ());
2819
+ return M != getModuleContext () && isResilient ();
2833
2820
}
2834
2821
llvm_unreachable (" bad resilience expansion" );
2835
2822
}
@@ -4782,6 +4769,14 @@ DestructorDecl *NominalTypeDecl::getValueTypeDestructor() {
4782
4769
return cast<DestructorDecl>(found[0 ]);
4783
4770
}
4784
4771
4772
+ static bool isOriginallyDefinedIn (const Decl *D, const ModuleDecl* MD) {
4773
+ if (!MD)
4774
+ return false ;
4775
+ if (D->getAlternateModuleName ().empty ())
4776
+ return false ;
4777
+ return D->getAlternateModuleName () == MD->getName ().str ();
4778
+ }
4779
+
4785
4780
bool NominalTypeDecl::isResilient (ModuleDecl *M,
4786
4781
ResilienceExpansion expansion) const {
4787
4782
switch (expansion) {
@@ -4791,9 +4786,8 @@ bool NominalTypeDecl::isResilient(ModuleDecl *M,
4791
4786
// We consider this decl belongs to the module either it's currently
4792
4787
// defined in this module or it's originally defined in this module, which
4793
4788
// is specified by @_originallyDefinedIn
4794
- return (M != getModuleContext () &&
4795
- !isOriginallyDefinedIn (this , M) &&
4796
- isResilient ());
4789
+ return M != getModuleContext () && !isOriginallyDefinedIn (this , M) &&
4790
+ isResilient ();
4797
4791
}
4798
4792
llvm_unreachable (" bad resilience expansion" );
4799
4793
}
0 commit comments