Sema: Split up gatherConstraints() into gatherAllConstraints() and gatherNearbyConstraints()

The two GatherKinds no longer share any implementation, so there's
no point keeping the logic together. Doing this also allows removing
the acceptConstraintFn from gatherAllConstraints(), which further
simplifies depthFirstSearch().
This commit is contained in:
Slava Pestov
2025-01-24 14:22:01 -05:00
parent 2500c83332
commit 6d8b55a9f6
7 changed files with 38 additions and 63 deletions

View File

@@ -15953,8 +15953,8 @@ ConstraintSystem::addKeyPathApplicationRootConstraint(Type root, ConstraintLocat
if (!typeVar)
return;
auto constraints = CG.gatherConstraints(
typeVar, ConstraintGraph::GatheringKind::EquivalenceClass,
auto constraints = CG.gatherNearbyConstraints(
typeVar,
[&keyPathExpr](Constraint *constraint) -> bool {
if (constraint->getKind() != ConstraintKind::KeyPath)
return false;