@@ -3090,75 +3090,6 @@ class ConstraintSystem {
3090
3090
ImplicitCallAsFunctionRoots;
3091
3091
3092
3092
private:
3093
- // / Describe the candidate expression for partial solving.
3094
- // / This class used by shrink & solve methods which apply
3095
- // / variation of directional path consistency algorithm in attempt
3096
- // / to reduce scopes of the overload sets (disjunctions) in the system.
3097
- class Candidate {
3098
- Expr *E;
3099
- DeclContext *DC;
3100
- llvm::BumpPtrAllocator &Allocator;
3101
-
3102
- // Contextual Information.
3103
- Type CT;
3104
- ContextualTypePurpose CTP;
3105
-
3106
- public:
3107
- Candidate (ConstraintSystem &cs, Expr *expr, Type ct = Type(),
3108
- ContextualTypePurpose ctp = ContextualTypePurpose::CTP_Unused)
3109
- : E(expr), DC(cs.DC), Allocator(cs.Allocator), CT(ct), CTP(ctp) {}
3110
-
3111
- // / Return underlying expression.
3112
- Expr *getExpr () const { return E; }
3113
-
3114
- // / Try to solve this candidate sub-expression
3115
- // / and re-write it's OSR domains afterwards.
3116
- // /
3117
- // / \param shrunkExprs The set of expressions which
3118
- // / domains have been successfully shrunk so far.
3119
- // /
3120
- // / \returns true on solver failure, false otherwise.
3121
- bool solve (llvm::SmallSetVector<OverloadSetRefExpr *, 4 > &shrunkExprs);
3122
-
3123
- // / Apply solutions found by solver as reduced OSR sets for
3124
- // / for current and all of it's sub-expressions.
3125
- // /
3126
- // / \param solutions The solutions found by running solver on the
3127
- // / this candidate expression.
3128
- // /
3129
- // / \param shrunkExprs The set of expressions which
3130
- // / domains have been successfully shrunk so far.
3131
- void applySolutions (
3132
- llvm::SmallVectorImpl<Solution> &solutions,
3133
- llvm::SmallSetVector<OverloadSetRefExpr *, 4 > &shrunkExprs) const ;
3134
-
3135
- // / Check if attempt at solving of the candidate makes sense given
3136
- // / the current conditions - number of shrunk domains which is related
3137
- // / to the given candidate over the total number of disjunctions present.
3138
- static bool
3139
- isTooComplexGiven (ConstraintSystem *const cs,
3140
- llvm::SmallSetVector<OverloadSetRefExpr *, 4 > &shrunkExprs) {
3141
- SmallVector<Constraint *, 8 > disjunctions;
3142
- cs->collectDisjunctions (disjunctions);
3143
-
3144
- unsigned unsolvedDisjunctions = disjunctions.size ();
3145
- for (auto *disjunction : disjunctions) {
3146
- auto *locator = disjunction->getLocator ();
3147
- if (!locator)
3148
- continue ;
3149
-
3150
- if (auto *OSR = getAsExpr<OverloadSetRefExpr>(locator->getAnchor ())) {
3151
- if (shrunkExprs.count (OSR) > 0 )
3152
- --unsolvedDisjunctions;
3153
- }
3154
- }
3155
-
3156
- unsigned threshold =
3157
- cs->getASTContext ().TypeCheckerOpts .SolverShrinkUnsolvedThreshold ;
3158
- return unsolvedDisjunctions >= threshold;
3159
- }
3160
- };
3161
-
3162
3093
// / Describes the current solver state.
3163
3094
struct SolverState {
3164
3095
SolverState (ConstraintSystem &cs,
@@ -5817,15 +5748,6 @@ class ConstraintSystem {
5817
5748
// / \returns true if an error occurred, false otherwise.
5818
5749
bool solveSimplified (SmallVectorImpl<Solution> &solutions);
5819
5750
5820
- // / Find reduced domains of disjunction constraints for given
5821
- // / expression, this is achieved to solving individual sub-expressions
5822
- // / and combining resolving types. Such algorithm is called directional
5823
- // / path consistency because it goes from children to parents for all
5824
- // / related sub-expressions taking union of their domains.
5825
- // /
5826
- // / \param expr The expression to find reductions for.
5827
- void shrink (Expr *expr);
5828
-
5829
5751
// / Pick a disjunction from the InactiveConstraints list.
5830
5752
// /
5831
5753
// / \returns The selected disjunction.
0 commit comments