File tree Expand file tree Collapse file tree 2 files changed +15
-24
lines changed Expand file tree Collapse file tree 2 files changed +15
-24
lines changed Original file line number Diff line number Diff line change @@ -346,12 +346,6 @@ class alignas(1 << DeclContextAlignInBits) DeclContext {
346
346
// / This is (unsigned)-1 if none of the outer contexts are generic.
347
347
unsigned getGenericContextDepth () const ;
348
348
349
- // / Retrieve the innermost generic parameters of this context or any
350
- // / of its parents.
351
- // /
352
- // / FIXME: Remove this
353
- GenericParamList *getGenericParamsOfContext () const ;
354
-
355
349
// / Retrieve the innermost generic signature of this context or any
356
350
// / of its parents.
357
351
GenericSignature *getGenericSignatureOfContext () const ;
Original file line number Diff line number Diff line change @@ -152,23 +152,6 @@ unsigned DeclContext::getGenericContextDepth() const {
152
152
return depth;
153
153
}
154
154
155
- GenericParamList *DeclContext::getGenericParamsOfContext () const {
156
- auto dc = this ;
157
- do {
158
- if (auto decl = dc->getAsDecl ()) {
159
- if (auto GC = decl->getAsGenericContext ()) {
160
- auto GP = GC->getGenericParams ();
161
-
162
- // Extensions do not capture outer generic parameters.
163
- if (GP != nullptr || isa<ExtensionDecl>(decl))
164
- return GP;
165
- }
166
- }
167
- } while ((dc = dc->getParent ()));
168
-
169
- return nullptr ;
170
- }
171
-
172
155
GenericSignature *DeclContext::getGenericSignatureOfContext () const {
173
156
auto dc = this ;
174
157
do {
@@ -305,7 +288,21 @@ DeclContext *DeclContext::getModuleScopeContext() const {
305
288
306
289
// / Determine whether the given context is generic at any level.
307
290
bool DeclContext::isGenericContext () const {
308
- return getGenericParamsOfContext () != nullptr ;
291
+ auto dc = this ;
292
+ do {
293
+ if (auto decl = dc->getAsDecl ()) {
294
+ if (auto GC = decl->getAsGenericContext ()) {
295
+ if (GC->getGenericParams ())
296
+ return true ;
297
+
298
+ // Extensions do not capture outer generic parameters.
299
+ if (isa<ExtensionDecl>(decl))
300
+ break ;
301
+ }
302
+ }
303
+ } while ((dc = dc->getParent ()));
304
+
305
+ return false ;
309
306
}
310
307
311
308
// / Get the most optimal resilience expansion for the body of this function.
You can’t perform that action at this time.
0 commit comments