@@ -1507,6 +1507,11 @@ class Solution {
15071507 // / to make the solution work.
15081508 std::vector<ConstraintFix *> Fixes;
15091509
1510+ // / The list of fixed requirements.
1511+ using FixedRequirement =
1512+ std::tuple<GenericTypeParamType *, unsigned , TypeBase *>;
1513+ std::vector<FixedRequirement> FixedRequirements;
1514+
15101515 // / Maps expressions for implied results (e.g implicit 'then' statements,
15111516 // / implicit 'return' statements in single expression body closures) to their
15121517 // / result kind.
@@ -2138,6 +2143,7 @@ class ConstraintSystem {
21382143 friend class RequirementFailure ;
21392144 friend class MissingMemberFailure ;
21402145 friend struct ClosureIsolatedByPreconcurrency ;
2146+ friend class SolverTrail ;
21412147
21422148 class SolverScope ;
21432149
@@ -2363,12 +2369,22 @@ class ConstraintSystem {
23632369 // / solver path.
23642370 using FixedRequirement =
23652371 std::tuple<GenericTypeParamType *, unsigned , TypeBase *>;
2366- llvm::SmallSetVector <FixedRequirement, 4 > FixedRequirements;
2372+ llvm::DenseSet <FixedRequirement> FixedRequirements;
23672373
23682374 bool isFixedRequirement (ConstraintLocator *reqLocator, Type requirementTy);
2375+
2376+ // / Add a fixed requirement and record a change to the trail.
23692377 void recordFixedRequirement (ConstraintLocator *reqLocator,
23702378 Type requirementTy);
23712379
2380+ // / Primitive form used when applying solution.
2381+ void recordFixedRequirement (GenericTypeParamType *paramTy,
2382+ unsigned reqKind, Type reqTy);
2383+
2384+ // / Called to undo the above change.
2385+ void removeFixedRequirement (GenericTypeParamType *paramTy,
2386+ unsigned reqKind, Type reqTy);
2387+
23722388 // / A mapping from constraint locators to the opened existential archetype
23732389 // / used for the 'self' of an existential type.
23742390 llvm::SmallMapVector<ConstraintLocator *, OpenedArchetypeType *, 4 >
@@ -2863,9 +2879,6 @@ class ConstraintSystem {
28632879 // / FIXME: Remove this.
28642880 unsigned numFixes;
28652881
2866- // / The length of \c FixedRequirements.
2867- unsigned numFixedRequirements;
2868-
28692882 // / The length of \c DisjunctionChoices.
28702883 unsigned numDisjunctionChoices;
28712884
0 commit comments