mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[CSSolver] Add skeleton of iterative solve
The idea so to split solving into non-recursive steps, represented by `SolverStep`, each of the steps is resposible for a unit of work e.g. attempting type variable or disjunction bindings/choices. Each step could produce more work via "follow-up" steps, complete "partial" solution when it's done, or error which terminates solver loop.
This commit is contained in:
@@ -57,6 +57,7 @@ class DisjunctionChoiceProducer;
|
||||
class TypeBinding;
|
||||
class TypeVariableBinding;
|
||||
class TypeVarBindingProducer;
|
||||
class SolverStep;
|
||||
|
||||
} // end namespace constraints
|
||||
|
||||
@@ -930,6 +931,7 @@ public:
|
||||
friend class FailureDiagnostic;
|
||||
friend class TypeVarBindingProducer;
|
||||
friend class TypeVariableBinding;
|
||||
friend class SolverStep;
|
||||
|
||||
class SolverScope;
|
||||
|
||||
@@ -3088,6 +3090,9 @@ public:
|
||||
/// \returns true if there are no solutions
|
||||
bool solveRec(SmallVectorImpl<Solution> &solutions);
|
||||
|
||||
bool solveIteratively(Expr *expr, SmallVectorImpl<Solution> &solutions,
|
||||
FreeTypeVariableBinding allowFreeTypeVariables);
|
||||
|
||||
/// \brief Solve the system of constraints.
|
||||
///
|
||||
/// \param allowFreeTypeVariables How to bind free type variables in
|
||||
|
||||
Reference in New Issue
Block a user