@@ -610,7 +610,7 @@ ConstraintSystem::solveSingle(FreeTypeVariableBinding allowFreeTypeVariables,
610
610
}
611
611
612
612
bool ConstraintSystem::Candidate::solve (
613
- llvm::SmallDenseSet <OverloadSetRefExpr *> &shrunkExprs) {
613
+ llvm::SmallSetVector <OverloadSetRefExpr *, 4 > &shrunkExprs) {
614
614
// Don't attempt to solve candidate if there is closure
615
615
// expression involved, because it's handled specially
616
616
// by parent constraint system (e.g. parameter lists).
@@ -722,11 +722,11 @@ bool ConstraintSystem::Candidate::solve(
722
722
723
723
void ConstraintSystem::Candidate::applySolutions (
724
724
llvm::SmallVectorImpl<Solution> &solutions,
725
- llvm::SmallDenseSet <OverloadSetRefExpr *> &shrunkExprs) const {
725
+ llvm::SmallSetVector <OverloadSetRefExpr *, 4 > &shrunkExprs) const {
726
726
// A collection of OSRs with their newly reduced domains,
727
727
// it's domains are sets because multiple solutions can have the same
728
728
// choice for one of the type variables, and we want no duplication.
729
- llvm::SmallDenseMap<OverloadSetRefExpr *, llvm::SmallSet <ValueDecl *, 2 >>
729
+ llvm::SmallDenseMap<OverloadSetRefExpr *, llvm::SmallSetVector <ValueDecl *, 2 >>
730
730
domains;
731
731
for (auto &solution : solutions) {
732
732
for (auto choice : solution.overloadChoices ) {
@@ -743,7 +743,7 @@ void ConstraintSystem::Candidate::applySolutions(
743
743
auto overload = choice.getSecond ().choice ;
744
744
auto type = overload.getDecl ()->getInterfaceType ();
745
745
746
- // One of the solutions has polymorphic type assigned with one of it's
746
+ // One of the solutions has polymorphic type associated with one of its
747
747
// type variables. Such functions can only be properly resolved
748
748
// via complete expression, so we'll have to forget solutions
749
749
// we have already recorded. They might not include all viable overload
@@ -1094,7 +1094,7 @@ void ConstraintSystem::shrink(Expr *expr) {
1094
1094
// so we can start solving them separately.
1095
1095
expr->walk (collector);
1096
1096
1097
- llvm::SmallDenseSet <OverloadSetRefExpr *> shrunkExprs;
1097
+ llvm::SmallSetVector <OverloadSetRefExpr *, 4 > shrunkExprs;
1098
1098
for (auto &candidate : collector.Candidates ) {
1099
1099
// If there are no results, let's forget everything we know about the
1100
1100
// system so far. This actually is ok, because some of the expressions
@@ -1110,7 +1110,7 @@ void ConstraintSystem::shrink(Expr *expr) {
1110
1110
return childExpr;
1111
1111
1112
1112
OSR->setDecls (domain->getSecond ());
1113
- shrunkExprs.erase (OSR);
1113
+ shrunkExprs.remove (OSR);
1114
1114
}
1115
1115
1116
1116
return childExpr;
0 commit comments