Skip to content

Commit 0800abf

Browse files
committed
SIL: Don't ask for stored properties of resilient types in getNumSubElements()
1 parent 7ac0381 commit 0800abf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/SILOptimizer/Mandatory/PredictableMemOpt.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ static unsigned getNumSubElements(SILType T, SILFunction &F,
102102
}
103103

104104
if (auto *SD = getFullyReferenceableStruct(T)) {
105+
if (SD->isResilient(F.getModule().getSwiftModule(),
106+
F.getResilienceExpansion())) {
107+
return false;
108+
}
109+
105110
unsigned NumElements = 0;
106111
for (auto *D : SD->getStoredProperties())
107112
NumElements +=

0 commit comments

Comments
 (0)