@@ -962,8 +962,21 @@ class GenericSignatureBuilder::RequirementSource final
962
962
PotentialArchetype *getRootPotentialArchetype () const ;
963
963
964
964
// / Retrieve the potential archetype to which this source refers.
965
- PotentialArchetype *getAffectedPotentialArchetype (
966
- GenericSignatureBuilder &builder) const ;
965
+ PotentialArchetype *getAffectedPotentialArchetype () const ;
966
+
967
+ // / Visit each of the potential archetypes along the path, from the root
968
+ // / potential archetype to each potential archetype named via (e.g.) a
969
+ // / protocol requirement or parent source.
970
+ // /
971
+ // / \param visitor Called with each potential archetype along the path along
972
+ // / with the requirement source that is being applied on top of that
973
+ // / potential archetype. Can return \c true to halt the search.
974
+ // /
975
+ // / \returns nullptr if any call to \c visitor returned true. Otherwise,
976
+ // / returns the potential archetype to which the entire source refers.
977
+ PotentialArchetype *visitPotentialArchetypesAlongPath (
978
+ llvm::function_ref<bool (PotentialArchetype *,
979
+ const RequirementSource *)> visitor) const ;
967
980
968
981
// / Whether the requirement is inferred or derived from an inferred
969
982
// / requirment.
@@ -979,22 +992,19 @@ class GenericSignatureBuilder::RequirementSource final
979
992
// / path.
980
993
bool isDerivedRequirement () const ;
981
994
982
- // / Whether the requirement is derived via some concrete conformance, e.g.,
983
- // / a concrete type's conformance to a protocol or a superclass's conformance
984
- // / to a protocol.
985
- bool isDerivedViaConcreteConformance () const ;
986
-
987
995
// / Determine whether the given derived requirement \c source, when rooted at
988
996
// / the potential archetype \c pa, is actually derived from the same
989
997
// / requirement. Such "self-derived" requirements do not make the original
990
998
// / requirement redundant, because without said original requirement, the
991
999
// / derived requirement ceases to hold.
992
- bool isSelfDerivedSource (PotentialArchetype *pa) const ;
1000
+ bool isSelfDerivedSource (PotentialArchetype *pa,
1001
+ bool &derivedViaConcrete) const ;
993
1002
994
1003
// / Determine whether a requirement \c pa: proto, when formed from this
995
1004
// / requirement source, is dependent on itself.
996
1005
bool isSelfDerivedConformance (PotentialArchetype *pa,
997
- ProtocolDecl *proto) const ;
1006
+ ProtocolDecl *proto,
1007
+ bool &derivedViaConcrete) const ;
998
1008
999
1009
// / Retrieve a source location that corresponds to the requirement.
1000
1010
SourceLoc getLoc () const ;
0 commit comments