@@ -3534,58 +3534,6 @@ class DisjunctionChoiceProducer : public BindingProducer<DisjunctionChoice> {
3534
3534
IsExplicitConversion);
3535
3535
}
3536
3536
};
3537
-
3538
- // / \brief Constraint System "component" represents
3539
- // / a single solvable unit, but the process of assigning
3540
- // / types in some cases allows it to be further split into
3541
- // / multiple smaller parts.
3542
- // /
3543
- // / This helps to abstract away logic of holding and
3544
- // / returning sub-set of the constraints in the system,
3545
- // / as well as its partial solving and result tracking.
3546
- class Component {
3547
- ConstraintList Constraints;
3548
- SmallVector<Constraint *, 8 > Disjunctions;
3549
-
3550
- public:
3551
- void reinstateTo (ConstraintList &workList) {
3552
- workList.splice (workList.end (), Constraints);
3553
- }
3554
-
3555
- void record (Constraint *constraint) {
3556
- Constraints.push_back (constraint);
3557
- if (constraint->getKind () == ConstraintKind::Disjunction)
3558
- Disjunctions.push_back (constraint);
3559
- }
3560
-
3561
- bool solve (ConstraintSystem &cs, SmallVectorImpl<Solution> &solutions) {
3562
- // Return constraints from the bucket back into circulation.
3563
- reinstateTo (cs.InactiveConstraints );
3564
-
3565
- // Solve for this component. If it fails, we're done.
3566
- bool failed;
3567
-
3568
- {
3569
- // Introduce a scope for this partial solution.
3570
- ConstraintSystem::SolverScope scope (cs);
3571
- llvm::SaveAndRestore<ConstraintSystem::SolverScope *>
3572
- partialSolutionScope (cs.solverState ->PartialSolutionScope , &scope);
3573
-
3574
- failed = cs.solveSimplified (solutions);
3575
- }
3576
-
3577
- // Put the constraints back into their original bucket.
3578
- Constraints.splice (Constraints.end (), cs.InactiveConstraints );
3579
- return failed;
3580
- }
3581
-
3582
- bool operator <(const Component &other) const {
3583
- return disjunctionCount () < other.disjunctionCount ();
3584
- }
3585
-
3586
- private:
3587
- unsigned disjunctionCount () const { return Disjunctions.size (); }
3588
- };
3589
3537
} // end namespace constraints
3590
3538
3591
3539
template <typename ...Args>
0 commit comments