@@ -2070,7 +2070,7 @@ void PatternMatchEmission::emitEnumElementDispatch(
2070
2070
defaultCaseCount);
2071
2071
2072
2072
// Okay, now emit all the cases.
2073
- blocks.forEachCase ([&](EnumElementDecl *elt , SILBasicBlock *caseBB,
2073
+ blocks.forEachCase ([&](EnumElementDecl *eltDecl , SILBasicBlock *caseBB,
2074
2074
const CaseInfo &caseInfo) {
2075
2075
SILLocation loc = caseInfo.FirstMatcher ;
2076
2076
auto &specializedRows = caseInfo.SpecializedRows ;
@@ -2085,8 +2085,8 @@ void PatternMatchEmission::emitEnumElementDispatch(
2085
2085
2086
2086
SILType eltTy;
2087
2087
bool hasElt = false ;
2088
- if (elt ->hasAssociatedValues ()) {
2089
- eltTy = src.getType ().getEnumElementType (elt , SGF.SGM .M ,
2088
+ if (eltDecl ->hasAssociatedValues ()) {
2089
+ eltTy = src.getType ().getEnumElementType (eltDecl , SGF.SGM .M ,
2090
2090
SGF.getTypeExpansionContext ());
2091
2091
hasElt = !eltTy.getASTType ()->isVoid ();
2092
2092
}
@@ -2140,7 +2140,7 @@ void PatternMatchEmission::emitEnumElementDispatch(
2140
2140
switch (eltConsumption) {
2141
2141
case CastConsumptionKind::TakeAlways:
2142
2142
eltValue =
2143
- SGF.B .createUncheckedTakeEnumDataAddr (loc, srcValue, elt , eltTy);
2143
+ SGF.B .createUncheckedTakeEnumDataAddr (loc, srcValue, eltDecl , eltTy);
2144
2144
break ;
2145
2145
case CastConsumptionKind::BorrowAlways:
2146
2146
// If we reach this point, we know that we have a loadable
@@ -2154,7 +2154,7 @@ void PatternMatchEmission::emitEnumElementDispatch(
2154
2154
SGF.B .createCopyAddr (loc, srcValue, copy, IsNotTake, IsInitialization);
2155
2155
// We can always take from the copy.
2156
2156
eltConsumption = CastConsumptionKind::TakeAlways;
2157
- eltValue = SGF.B .createUncheckedTakeEnumDataAddr (loc, copy, elt , eltTy);
2157
+ eltValue = SGF.B .createUncheckedTakeEnumDataAddr (loc, copy, eltDecl , eltTy);
2158
2158
break ;
2159
2159
}
2160
2160
@@ -2186,7 +2186,7 @@ void PatternMatchEmission::emitEnumElementDispatch(
2186
2186
eltCMV = origCMV;
2187
2187
2188
2188
// If the payload is boxed, project it.
2189
- if (elt ->isIndirect () || elt ->getParentEnum ()->isIndirect ()) {
2189
+ if (eltDecl ->isIndirect () || eltDecl ->getParentEnum ()->isIndirect ()) {
2190
2190
ManagedValue boxedValue =
2191
2191
SGF.B .createProjectBox (loc, origCMV.getFinalManagedValue (), 0 );
2192
2192
eltTL = &SGF.getTypeLowering (boxedValue.getType ());
@@ -2202,14 +2202,14 @@ void PatternMatchEmission::emitEnumElementDispatch(
2202
2202
2203
2203
// Reabstract to the substituted type, if needed.
2204
2204
CanType substEltTy =
2205
- sourceType->getTypeOfMember (SGF.SGM .M .getSwiftModule (), elt ,
2206
- elt ->getArgumentInterfaceType ())
2205
+ sourceType->getTypeOfMember (SGF.SGM .M .getSwiftModule (), eltDecl ,
2206
+ eltDecl ->getArgumentInterfaceType ())
2207
2207
->getCanonicalType ();
2208
2208
2209
2209
AbstractionPattern origEltTy =
2210
- (elt ->getParentEnum ()->isOptionalDecl ()
2210
+ (eltDecl ->getParentEnum ()->isOptionalDecl ()
2211
2211
? AbstractionPattern (substEltTy)
2212
- : SGF.SGM .M .Types .getAbstractionPattern (elt ));
2212
+ : SGF.SGM .M .Types .getAbstractionPattern (eltDecl ));
2213
2213
2214
2214
eltCMV = emitReabstractedSubobject (SGF, loc, eltCMV, *eltTL,
2215
2215
origEltTy, substEltTy);
0 commit comments