File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed
Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1334,6 +1334,10 @@ class GenericParamList final :
13341334 SWIFT_DEBUG_DUMP;
13351335
13361336 bool walk (ASTWalker &walker);
1337+
1338+ // / Finds a generic parameter declaration by name. This should only
1339+ // / be used from the SIL parser.
1340+ GenericTypeParamDecl *lookUpGenericParam (Identifier name) const ;
13371341};
13381342
13391343// / A trailing where clause.
Original file line number Diff line number Diff line change @@ -960,6 +960,21 @@ void GenericParamList::setDeclContext(DeclContext *dc) {
960960 param->setDeclContext (dc);
961961}
962962
963+ GenericTypeParamDecl *GenericParamList::lookUpGenericParam (
964+ Identifier name) const {
965+ for (const auto *innerParams = this ;
966+ innerParams != nullptr ;
967+ innerParams = innerParams->getOuterParameters ()) {
968+ for (auto *paramDecl : *innerParams) {
969+ if (name == paramDecl->getName ()) {
970+ return const_cast <GenericTypeParamDecl *>(paramDecl);
971+ }
972+ }
973+ }
974+
975+ return nullptr ;
976+ }
977+
963978TrailingWhereClause::TrailingWhereClause (
964979 SourceLoc whereLoc,
965980 ArrayRef<RequirementRepr> requirements)
You can’t perform that action at this time.
0 commit comments