@@ -2129,11 +2129,6 @@ class SyntacticElementTargetRewriter {
21292129 virtual ~SyntacticElementTargetRewriter () = default ;
21302130};
21312131
2132- enum class ConstraintSystemPhase {
2133- ConstraintGeneration,
2134- Solving
2135- };
2136-
21372132// / Retrieve the closure type from the constraint system.
21382133struct GetClosureType {
21392134 ConstraintSystem &cs;
@@ -2195,9 +2190,6 @@ class ConstraintSystem {
21952190 // / Do not set directly, call \c recordFailedConstraint instead.
21962191 Constraint *failedConstraint = nullptr ;
21972192
2198- // / Current phase of the constraint system lifetime.
2199- ConstraintSystemPhase Phase = ConstraintSystemPhase::ConstraintGeneration;
2200-
22012193 // / The set of expressions for which we have generated constraints.
22022194 llvm::SetVector<Expr *> InputExprs;
22032195
@@ -2675,30 +2667,6 @@ class ConstraintSystem {
26752667 // / \c nullptr if no constraint has failed.
26762668 Constraint *getFailedConstraint () const { return failedConstraint; }
26772669
2678- ConstraintSystemPhase getPhase () const { return Phase; }
2679-
2680- // / Move constraint system to a new phase of its lifetime.
2681- void setPhase (ConstraintSystemPhase newPhase) {
2682- if (Phase == newPhase)
2683- return ;
2684-
2685- #ifndef NDEBUG
2686- switch (Phase) {
2687- case ConstraintSystemPhase::ConstraintGeneration:
2688- assert (newPhase == ConstraintSystemPhase::Solving);
2689- break ;
2690-
2691- case ConstraintSystemPhase::Solving:
2692- // We can come back to constraint generation phase while
2693- // processing result builder body.
2694- assert (newPhase == ConstraintSystemPhase::ConstraintGeneration);
2695- break ;
2696- }
2697- #endif
2698-
2699- Phase = newPhase;
2700- }
2701-
27022670 // / Check whether constraint system is in valid state e.g.
27032671 // / has left-over active/inactive constraints which should
27042672 // / have been simplified.
@@ -3906,7 +3874,7 @@ class ConstraintSystem {
39063874 // Add this constraint to the constraint graph.
39073875 CG.addConstraint (constraint);
39083876
3909- if (isDebugMode () && getPhase () == ConstraintSystemPhase::Solving ) {
3877+ if (isDebugMode () && solverState ) {
39103878 auto &log = llvm::errs ();
39113879 log.indent (solverState->getCurrentIndent () + 4 ) << " (added constraint: " ;
39123880 constraint->print (log, &getASTContext ().SourceMgr ,
@@ -3927,7 +3895,7 @@ class ConstraintSystem {
39273895 if (solverState)
39283896 recordChange (SolverTrail::Change::RetiredConstraint (where, constraint));
39293897
3930- if (isDebugMode () && getPhase () == ConstraintSystemPhase::Solving ) {
3898+ if (isDebugMode () && solverState ) {
39313899 auto &log = llvm::errs ();
39323900 log.indent (solverState->getCurrentIndent () + 4 )
39333901 << " (removed constraint: " ;
0 commit comments