@@ -1690,10 +1690,9 @@ void PatternMatchEmission::emitIsDispatch(ArrayRef<RowToSpecialize> rows,
1690
1690
1691
1691
namespace {
1692
1692
struct CaseInfo {
1693
- EnumElementDecl *FormalElement ;
1693
+ SmallVector<SpecializedRow, 2 > SpecializedRows ;
1694
1694
Pattern *FirstMatcher;
1695
1695
bool Irrefutable = false ;
1696
- SmallVector<SpecializedRow, 2 > SpecializedRows;
1697
1696
};
1698
1697
1699
1698
class CaseBlocks {
@@ -1773,7 +1772,6 @@ CaseBlocks::CaseBlocks(
1773
1772
curBB = SGF.createBasicBlock (curBB);
1774
1773
CaseBBs.push_back ({formalElt, curBB});
1775
1774
CaseInfos.push_back (CaseInfo ());
1776
- CaseInfos.back ().FormalElement = formalElt;
1777
1775
CaseInfos.back ().FirstMatcher = row.Pattern ;
1778
1776
CaseCounts.push_back (row.Count );
1779
1777
}
@@ -1852,7 +1850,6 @@ void PatternMatchEmission::emitEnumElementDispatchWithOwnership(
1852
1850
const CaseInfo &caseInfo) {
1853
1851
SILLocation loc = caseInfo.FirstMatcher ;
1854
1852
auto &specializedRows = caseInfo.SpecializedRows ;
1855
- EnumElementDecl *formalElt = caseInfo.FormalElement ;
1856
1853
1857
1854
SGF.B .setInsertionPoint (caseBB);
1858
1855
@@ -1927,8 +1924,8 @@ void PatternMatchEmission::emitEnumElementDispatchWithOwnership(
1927
1924
1928
1925
CanType substEltTy =
1929
1926
sourceType
1930
- ->getTypeOfMember (SGF.SGM .M .getSwiftModule (), formalElt ,
1931
- formalElt ->getArgumentInterfaceType ())
1927
+ ->getTypeOfMember (SGF.SGM .M .getSwiftModule (), elt ,
1928
+ elt ->getArgumentInterfaceType ())
1932
1929
->getCanonicalType ();
1933
1930
1934
1931
AbstractionPattern origEltTy =
@@ -2014,7 +2011,6 @@ void PatternMatchEmission::emitEnumElementDispatch(
2014
2011
const CaseInfo &caseInfo) {
2015
2012
SILLocation loc = caseInfo.FirstMatcher ;
2016
2013
auto &specializedRows = caseInfo.SpecializedRows ;
2017
- EnumElementDecl *formalElt = caseInfo.FormalElement ;
2018
2014
2019
2015
SGF.B .setInsertionPoint (caseBB);
2020
2016
@@ -2137,8 +2133,8 @@ void PatternMatchEmission::emitEnumElementDispatch(
2137
2133
// Reabstract to the substituted type, if needed.
2138
2134
2139
2135
CanType substEltTy =
2140
- sourceType->getTypeOfMember (SGF.SGM .M .getSwiftModule (), formalElt ,
2141
- formalElt ->getArgumentInterfaceType ())
2136
+ sourceType->getTypeOfMember (SGF.SGM .M .getSwiftModule (), elt ,
2137
+ elt ->getArgumentInterfaceType ())
2142
2138
->getCanonicalType ();
2143
2139
2144
2140
AbstractionPattern origEltTy =
0 commit comments