@@ -1018,6 +1018,7 @@ class ConstraintSystem {
10181018 Expr *E;
10191019 TypeChecker &TC;
10201020 DeclContext *DC;
1021+ llvm::BumpPtrAllocator &Allocator;
10211022
10221023 // Contextual Information.
10231024 Type CT;
@@ -1026,7 +1027,8 @@ class ConstraintSystem {
10261027 public:
10271028 Candidate (ConstraintSystem &cs, Expr *expr, Type ct = Type(),
10281029 ContextualTypePurpose ctp = ContextualTypePurpose::CTP_Unused)
1029- : E(expr), TC(cs.TC), DC(cs.DC), CT(ct), CTP(ctp) {}
1030+ : E(expr), TC(cs.TC), DC(cs.DC), Allocator(cs.Allocator), CT(ct),
1031+ CTP (ctp) {}
10301032
10311033 // / \brief Return underlying expression.
10321034 Expr *getExpr () const { return E; }
@@ -1038,7 +1040,7 @@ class ConstraintSystem {
10381040 // / domains have been successfully shrunk so far.
10391041 // /
10401042 // / \returns true on solver failure, false otherwise.
1041- bool solve (llvm::SmallDenseSet<Expr *> &shrunkExprs);
1043+ bool solve (llvm::SmallDenseSet<OverloadSetRefExpr *> &shrunkExprs);
10421044
10431045 // / \brief Apply solutions found by solver as reduced OSR sets for
10441046 // / for current and all of it's sub-expressions.
@@ -1048,14 +1050,16 @@ class ConstraintSystem {
10481050 // /
10491051 // / \param shrunkExprs The set of expressions which
10501052 // / domains have been successfully shrunk so far.
1051- void applySolutions (llvm::SmallVectorImpl<Solution> &solutions,
1052- llvm::SmallDenseSet<Expr *> &shrunkExprs) const ;
1053+ void applySolutions (
1054+ llvm::SmallVectorImpl<Solution> &solutions,
1055+ llvm::SmallDenseSet<OverloadSetRefExpr *> &shrunkExprs) const ;
10531056
10541057 // / Check if attempt at solving of the candidate makes sense given
10551058 // / the current conditions - number of shrunk domains which is related
10561059 // / to the given candidate over the total number of disjunctions present.
1057- static bool isTooComplexGiven (ConstraintSystem *const cs,
1058- llvm::SmallDenseSet<Expr *> &shrunkExprs) {
1060+ static bool
1061+ isTooComplexGiven (ConstraintSystem *const cs,
1062+ llvm::SmallDenseSet<OverloadSetRefExpr *> &shrunkExprs) {
10591063 SmallVector<Constraint *, 8 > disjunctions;
10601064 cs->collectDisjunctions (disjunctions);
10611065
@@ -1066,7 +1070,11 @@ class ConstraintSystem {
10661070 continue ;
10671071
10681072 if (auto *anchor = locator->getAnchor ()) {
1069- if (shrunkExprs.count (anchor) > 0 )
1073+ auto *OSR = dyn_cast<OverloadSetRefExpr>(anchor);
1074+ if (!OSR)
1075+ continue ;
1076+
1077+ if (shrunkExprs.count (OSR) > 0 )
10701078 --unsolvedDisjunctions;
10711079 }
10721080 }
0 commit comments