Skip to content

Commit e0163bd

Browse files
authored
Merge pull request #19441 from rudkx/remove-component
[ConstraintSystem] Remove Component, which is no longer used.
2 parents 0ad67cb + 4fa2f15 commit e0163bd

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

lib/Sema/ConstraintSystem.h

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3534,58 +3534,6 @@ class DisjunctionChoiceProducer : public BindingProducer<DisjunctionChoice> {
35343534
IsExplicitConversion);
35353535
}
35363536
};
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-
};
35893537
} // end namespace constraints
35903538

35913539
template<typename ...Args>

0 commit comments

Comments
 (0)