diff --git a/include/swift/Sema/ConstraintSystem.h b/include/swift/Sema/ConstraintSystem.h index 832d566ff0f..146126fd8a4 100644 --- a/include/swift/Sema/ConstraintSystem.h +++ b/include/swift/Sema/ConstraintSystem.h @@ -2131,9 +2131,7 @@ public: enum class ConstraintSystemPhase { ConstraintGeneration, - Solving, - Diagnostics, - Finalization + Solving }; /// Retrieve the closure type from the constraint system. @@ -2693,18 +2691,7 @@ public: case ConstraintSystemPhase::Solving: // We can come back to constraint generation phase while // processing result builder body. - assert(newPhase == ConstraintSystemPhase::ConstraintGeneration || - newPhase == ConstraintSystemPhase::Diagnostics || - newPhase == ConstraintSystemPhase::Finalization); - break; - - case ConstraintSystemPhase::Diagnostics: - assert(newPhase == ConstraintSystemPhase::Solving || - newPhase == ConstraintSystemPhase::Finalization); - break; - - case ConstraintSystemPhase::Finalization: - assert(newPhase == ConstraintSystemPhase::Diagnostics); + assert(newPhase == ConstraintSystemPhase::ConstraintGeneration); break; } #endif diff --git a/lib/Sema/CSSolver.cpp b/lib/Sema/CSSolver.cpp index 44e80480e0c..f6aaa1ce118 100644 --- a/lib/Sema/CSSolver.cpp +++ b/lib/Sema/CSSolver.cpp @@ -1579,8 +1579,6 @@ void ConstraintSystem::solveImpl(SmallVectorImpl &solutions) { setPhase(ConstraintSystemPhase::Solving); - SWIFT_DEFER { setPhase(ConstraintSystemPhase::Finalization); }; - // If constraint system failed while trying to // genenerate constraints, let's stop right here. if (failedConstraint) diff --git a/lib/Sema/ConstraintSystem.cpp b/lib/Sema/ConstraintSystem.cpp index c1787e34563..e5a1c0e9c7f 100644 --- a/lib/Sema/ConstraintSystem.cpp +++ b/lib/Sema/ConstraintSystem.cpp @@ -2098,8 +2098,6 @@ SolutionResult ConstraintSystem::salvage() { llvm::errs() << "---Attempting to salvage and emit diagnostics---\n"; } - setPhase(ConstraintSystemPhase::Diagnostics); - // Attempt to solve again, capturing all states that come from our attempts to // select overloads or bind type variables. // @@ -4797,10 +4795,6 @@ void SyntacticElementTargetKey::dump(raw_ostream &OS) const { /// This is guaranteed to always emit an error message. /// void ConstraintSystem::diagnoseFailureFor(SyntacticElementTarget target) { - setPhase(ConstraintSystemPhase::Diagnostics); - - SWIFT_DEFER { setPhase(ConstraintSystemPhase::Finalization); }; - auto &DE = getASTContext().Diags; // If constraint system is in invalid state always produce