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 :
1334
1334
SWIFT_DEBUG_DUMP;
1335
1335
1336
1336
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 ;
1337
1341
};
1338
1342
1339
1343
// / A trailing where clause.
Original file line number Diff line number Diff line change @@ -960,6 +960,21 @@ void GenericParamList::setDeclContext(DeclContext *dc) {
960
960
param->setDeclContext (dc);
961
961
}
962
962
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
+
963
978
TrailingWhereClause::TrailingWhereClause (
964
979
SourceLoc whereLoc,
965
980
ArrayRef<RequirementRepr> requirements)
You can’t perform that action at this time.
0 commit comments