@@ -63,10 +63,10 @@ class TypeListPackMatcher {
63
63
SmallVector<MatchedPair, 4 > pairs;
64
64
65
65
[[nodiscard]] bool match () {
66
- ArrayRef<Element> lhsParams (lhsElements);
67
- ArrayRef<Element> rhsParams (rhsElements);
66
+ ArrayRef<Element> lhsElts (lhsElements);
67
+ ArrayRef<Element> rhsElts (rhsElements);
68
68
69
- unsigned minLength = std::min (lhsParams .size (), rhsParams .size ());
69
+ unsigned minLength = std::min (lhsElts .size (), rhsElts .size ());
70
70
71
71
// Consume the longest possible prefix where neither type in
72
72
// the pair is a pack expansion type.
@@ -75,8 +75,8 @@ class TypeListPackMatcher {
75
75
unsigned lhsIdx = i;
76
76
unsigned rhsIdx = i;
77
77
78
- auto lhsElt = lhsParams [lhsIdx];
79
- auto rhsElt = rhsParams [rhsIdx];
78
+ auto lhsElt = lhsElts [lhsIdx];
79
+ auto rhsElt = rhsElts [rhsIdx];
80
80
81
81
if (getElementLabel (lhsElt) != getElementLabel (rhsElt))
82
82
break ;
@@ -101,11 +101,11 @@ class TypeListPackMatcher {
101
101
// the pair is a pack expansion type.
102
102
unsigned suffixLength = 0 ;
103
103
for (unsigned i = 0 ; i < minLength - prefixLength; ++i) {
104
- unsigned lhsIdx = lhsParams .size () - i - 1 ;
105
- unsigned rhsIdx = rhsParams .size () - i - 1 ;
104
+ unsigned lhsIdx = lhsElts .size () - i - 1 ;
105
+ unsigned rhsIdx = rhsElts .size () - i - 1 ;
106
106
107
- auto lhsElt = lhsParams [lhsIdx];
108
- auto rhsElt = rhsParams [rhsIdx];
107
+ auto lhsElt = lhsElts [lhsIdx];
108
+ auto rhsElt = rhsElts [rhsIdx];
109
109
110
110
// FIXME: Check flags
111
111
@@ -124,27 +124,27 @@ class TypeListPackMatcher {
124
124
++suffixLength;
125
125
}
126
126
127
- assert (prefixLength + suffixLength <= lhsParams .size ());
128
- assert (prefixLength + suffixLength <= rhsParams .size ());
127
+ assert (prefixLength + suffixLength <= lhsElts .size ());
128
+ assert (prefixLength + suffixLength <= rhsElts .size ());
129
129
130
130
// Drop the consumed prefix and suffix from each list of types.
131
- lhsParams = lhsParams .drop_front (prefixLength).drop_back (suffixLength);
132
- rhsParams = rhsParams .drop_front (prefixLength).drop_back (suffixLength);
131
+ lhsElts = lhsElts .drop_front (prefixLength).drop_back (suffixLength);
132
+ rhsElts = rhsElts .drop_front (prefixLength).drop_back (suffixLength);
133
133
134
134
// If nothing remains, we're done.
135
- if (lhsParams .empty () && rhsParams .empty ())
135
+ if (lhsElts .empty () && rhsElts .empty ())
136
136
return false ;
137
137
138
138
// If the left hand side is a single pack expansion type, bind it
139
139
// to what remains of the right hand side.
140
- if (lhsParams .size () == 1 ) {
141
- auto lhsType = getElementType (lhsParams [0 ]);
140
+ if (lhsElts .size () == 1 ) {
141
+ auto lhsType = getElementType (lhsElts [0 ]);
142
142
if (auto *lhsExpansion = lhsType->template getAs <PackExpansionType>()) {
143
143
unsigned lhsIdx = prefixLength;
144
144
unsigned rhsIdx = prefixLength;
145
145
146
146
SmallVector<Type, 2 > rhsTypes;
147
- for (auto rhsElt : rhsParams ) {
147
+ for (auto rhsElt : rhsElts ) {
148
148
if (!getElementLabel (rhsElt).empty ())
149
149
return true ;
150
150
@@ -161,14 +161,14 @@ class TypeListPackMatcher {
161
161
162
162
// If the right hand side is a single pack expansion type, bind it
163
163
// to what remains of the left hand side.
164
- if (rhsParams .size () == 1 ) {
165
- auto rhsType = getElementType (rhsParams [0 ]);
164
+ if (rhsElts .size () == 1 ) {
165
+ auto rhsType = getElementType (rhsElts [0 ]);
166
166
if (auto *rhsExpansion = rhsType->template getAs <PackExpansionType>()) {
167
167
unsigned lhsIdx = prefixLength;
168
168
unsigned rhsIdx = prefixLength;
169
169
170
170
SmallVector<Type, 2 > lhsTypes;
171
- for (auto lhsElt : lhsParams ) {
171
+ for (auto lhsElt : lhsElts ) {
172
172
if (!getElementLabel (lhsElt).empty ())
173
173
return true ;
174
174
0 commit comments