File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -197,6 +197,11 @@ class GenericSignature {
197
197
// / array of the generic parameters for the innermost generic type.
198
198
ArrayRef<GenericTypeParamType *> getInnermostGenericParams () const ;
199
199
200
+ // / Returns the depth that a generic parameter at the next level of
201
+ // / nesting would have. This is zero for the empty signature,
202
+ // / and one plus the depth of the final generic parameter otherwise.
203
+ unsigned getNextDepth () const ;
204
+
200
205
// / Retrieve the requirements.
201
206
ArrayRef<Requirement> getRequirements () const ;
202
207
@@ -307,6 +312,9 @@ class alignas(1 << TypeAlignInBits) GenericSignatureImpl final
307
312
return Mem;
308
313
}
309
314
315
+ // / Returns the depth of the last generic parameter.
316
+ unsigned getMaxDepth () const ;
317
+
310
318
// / Transform the requirements into a form where implicit Copyable and
311
319
// / Escapable conformances are omitted, and their absence is explicitly
312
320
// / noted.
Original file line number Diff line number Diff line change @@ -95,6 +95,16 @@ GenericSignatureImpl::getInnermostGenericParams() const {
95
95
return params.slice (sliceCount);
96
96
}
97
97
98
+ unsigned GenericSignatureImpl::getMaxDepth () const {
99
+ return getGenericParams ().back ()->getDepth ();
100
+ }
101
+
102
+ unsigned GenericSignature::getNextDepth () const {
103
+ if (!getPointer ())
104
+ return 0 ;
105
+ return getPointer ()->getMaxDepth () + 1 ;
106
+ }
107
+
98
108
void GenericSignatureImpl::forEachParam (
99
109
llvm::function_ref<void (GenericTypeParamType *, bool )> callback) const {
100
110
// Figure out which generic parameters are concrete or same-typed to another
You can’t perform that action at this time.
0 commit comments