Skip to content

Commit d430bb0

Browse files
committed
Sink the logic into getResilienceExpansionForLayout
This clearly satisfies the postcondition that 'Calling isResilient() with this scope will always return false.'
1 parent 1772e77 commit d430bb0

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4137,6 +4137,9 @@ IRGenModule::getResilienceExpansionForAccess(NominalTypeDecl *decl) {
41374137
// layout. Calling isResilient() with this scope will always return false.
41384138
ResilienceExpansion
41394139
IRGenModule::getResilienceExpansionForLayout(NominalTypeDecl *decl) {
4140+
if (TC.isCompletelyFragile())
4141+
return ResilienceExpansion::Minimal;
4142+
41404143
if (isResilient(decl, ResilienceExpansion::Minimal))
41414144
return ResilienceExpansion::Maximal;
41424145

lib/IRGen/GenEnum.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5258,12 +5258,6 @@ EnumImplStrategy::get(TypeConverter &TC, SILType type, EnumDecl *theEnum) {
52585258
// fixed-size from this resilience scope.
52595259
ResilienceExpansion layoutScope =
52605260
TC.IGM.getResilienceExpansionForLayout(theEnum);
5261-
if (TC.isCompletelyFragile()) {
5262-
// If we forced completely fragile layout we need to check the
5263-
// fixed-sized'ness in the minimal scope. Otherwise, we get wrong answer for
5264-
// private resilient enum types that have an resilient payload.
5265-
layoutScope = ResilienceExpansion::Minimal;
5266-
}
52675261

52685262
for (auto elt : theEnum->getAllElements()) {
52695263
numElements++;

0 commit comments

Comments
 (0)