@@ -1519,9 +1519,8 @@ static Constraint *selectBestBindingDisjunction(
1519
1519
if (!firstBindDisjunction)
1520
1520
firstBindDisjunction = disjunction;
1521
1521
1522
- llvm::SetVector<Constraint *> constraints;
1523
- cs.getConstraintGraph ().gatherConstraints (
1524
- typeVar, constraints, ConstraintGraph::GatheringKind::EquivalenceClass,
1522
+ auto constraints = cs.getConstraintGraph ().gatherConstraints (
1523
+ typeVar, ConstraintGraph::GatheringKind::EquivalenceClass,
1525
1524
[](Constraint *constraint) {
1526
1525
return constraint->getKind () == ConstraintKind::Conversion;
1527
1526
});
@@ -1576,9 +1575,8 @@ void ConstraintSystem::ArgumentInfoCollector::walk(Type argType) {
1576
1575
1577
1576
visited.insert (rep);
1578
1577
1579
- llvm::SetVector<Constraint *> constraints;
1580
- CS.getConstraintGraph ().gatherConstraints (
1581
- rep, constraints, ConstraintGraph::GatheringKind::EquivalenceClass);
1578
+ auto constraints = CS.getConstraintGraph ().gatherConstraints (
1579
+ rep, ConstraintGraph::GatheringKind::EquivalenceClass);
1582
1580
1583
1581
for (auto *constraint : constraints) {
1584
1582
switch (constraint->getKind ()) {
@@ -1772,9 +1770,8 @@ Constraint *ConstraintSystem::getUnboundBindOverloadDisjunction(
1772
1770
while (visitedVars.insert (rep).second ) {
1773
1771
// Look for a disjunction that binds this type variable to an overload set.
1774
1772
TypeVariableType *optionalObjectTypeVar = nullptr ;
1775
- llvm::SetVector<Constraint *> disjunctions;
1776
- getConstraintGraph ().gatherConstraints (
1777
- rep, disjunctions, ConstraintGraph::GatheringKind::EquivalenceClass,
1773
+ auto disjunctions = getConstraintGraph ().gatherConstraints (
1774
+ rep, ConstraintGraph::GatheringKind::EquivalenceClass,
1778
1775
[this , rep, &optionalObjectTypeVar](Constraint *match) {
1779
1776
// If we have an "optional object of" constraint where the right-hand
1780
1777
// side is this type variable, we may need to follow that type
@@ -1875,9 +1872,8 @@ void ConstraintSystem::sortDesignatedTypes(
1875
1872
SmallVectorImpl<NominalTypeDecl *> &nominalTypes,
1876
1873
Constraint *bindOverload) {
1877
1874
auto *tyvar = bindOverload->getFirstType ()->castTo <TypeVariableType>();
1878
- llvm::SetVector<Constraint *> applicableFns;
1879
- getConstraintGraph ().gatherConstraints (
1880
- tyvar, applicableFns, ConstraintGraph::GatheringKind::EquivalenceClass,
1875
+ auto applicableFns = getConstraintGraph ().gatherConstraints (
1876
+ tyvar, ConstraintGraph::GatheringKind::EquivalenceClass,
1881
1877
[](Constraint *match) {
1882
1878
return match->getKind () == ConstraintKind::ApplicableFunction;
1883
1879
});
@@ -2292,21 +2288,21 @@ void DisjunctionChoice::propagateConversionInfo(ConstraintSystem &cs) const {
2292
2288
return ;
2293
2289
2294
2290
auto conversionType = bindings.Bindings [0 ].BindingType ;
2295
- llvm::SetVector<Constraint *> constraints;
2296
- cs. CG . gatherConstraints (typeVar, constraints ,
2297
- ConstraintGraph::GatheringKind::EquivalenceClass,
2298
- [](Constraint *constraint) -> bool {
2299
- switch (constraint->getKind ()) {
2300
- case ConstraintKind::Conversion:
2301
- case ConstraintKind::Defaultable:
2302
- case ConstraintKind::ConformsTo:
2303
- case ConstraintKind::LiteralConformsTo:
2304
- return false ;
2305
-
2306
- default :
2307
- return true ;
2308
- }
2309
- });
2291
+ auto constraints = cs. CG . gatherConstraints (
2292
+ typeVar ,
2293
+ ConstraintGraph::GatheringKind::EquivalenceClass,
2294
+ [](Constraint *constraint) -> bool {
2295
+ switch (constraint->getKind ()) {
2296
+ case ConstraintKind::Conversion:
2297
+ case ConstraintKind::Defaultable:
2298
+ case ConstraintKind::ConformsTo:
2299
+ case ConstraintKind::LiteralConformsTo:
2300
+ return false ;
2301
+
2302
+ default :
2303
+ return true ;
2304
+ }
2305
+ });
2310
2306
2311
2307
if (constraints.empty ())
2312
2308
cs.addConstraint (ConstraintKind::Bind, typeVar, conversionType,
0 commit comments