@@ -2331,7 +2331,7 @@ class ConstraintSystem {
23312331
23322332 // / The set of implicit value conversions performed by the solver on
23332333 // / a current path to reach a solution.
2334- llvm::SmallMapVector <ConstraintLocator *, ConversionRestrictionKind, 2 >
2334+ llvm::SmallDenseMap <ConstraintLocator *, ConversionRestrictionKind, 2 >
23352335 ImplicitValueConversions;
23362336
23372337 // / The worklist of "active" constraints that should be revisited
@@ -2415,11 +2415,6 @@ class ConstraintSystem {
24152415 }
24162416 }
24172417
2418- void removeDefaultedConstraint (ConstraintLocator *locator) {
2419- bool erased = DefaultedConstraints.erase (locator);
2420- ASSERT (erased);
2421- }
2422-
24232418 // / A cache that stores the @dynamicCallable required methods implemented by
24242419 // / types.
24252420 llvm::DenseMap<NominalTypeDecl *, DynamicCallableMethods>
@@ -2855,9 +2850,6 @@ class ConstraintSystem {
28552850 // / FIXME: Remove this.
28562851 unsigned numFixes;
28572852
2858- // / The length of \c ImplicitValueConversions.
2859- unsigned numImplicitValueConversions;
2860-
28612853 // / The length of \c KeyPaths.
28622854 unsigned numKeyPaths;
28632855
@@ -3453,12 +3445,6 @@ class ConstraintSystem {
34533445 void recordOpenedExistentialType (ConstraintLocator *locator,
34543446 OpenedArchetypeType *opened);
34553447
3456- // / Undo the above change.
3457- void removeOpenedExistentialType (ConstraintLocator *locator) {
3458- bool erased = OpenedExistentialTypes.erase (locator);
3459- ASSERT (erased);
3460- }
3461-
34623448 // / Get the opened element generic environment for the given locator.
34633449 GenericEnvironment *getPackElementEnvironment (ConstraintLocator *locator,
34643450 CanType shapeClass);
@@ -3467,12 +3453,6 @@ class ConstraintSystem {
34673453 void recordPackExpansionEnvironment (ConstraintLocator *locator,
34683454 std::pair<UUID, Type> uuidAndShape);
34693455
3470- // / Undo the above change.
3471- void removePackExpansionEnvironment (ConstraintLocator *locator) {
3472- bool erased = PackExpansionEnvironments.erase (locator);
3473- ASSERT (erased);
3474- }
3475-
34763456 // / Get the opened element generic environment for the given pack element.
34773457 PackExpansionExpr *getPackEnvironment (PackElementExpr *packElement) const ;
34783458
@@ -3655,12 +3635,6 @@ class ConstraintSystem {
36553635 void recordMatchCallArgumentResult (ConstraintLocator *locator,
36563636 MatchCallArgumentResult result);
36573637
3658- // / Undo the above change.
3659- void removeMatchCallArgumentResult (ConstraintLocator *locator) {
3660- bool erased = argumentMatchingChoices.erase (locator);
3661- ASSERT (erased);
3662- }
3663-
36643638 // / Record implicitly generated `callAsFunction` with root at the
36653639 // / given expression, located at \c locator.
36663640 void recordCallAsFunction (UnresolvedDotExpr *root, ArgumentList *arguments,
@@ -4438,9 +4412,6 @@ class ConstraintSystem {
44384412 void recordOpenedType (
44394413 ConstraintLocator *locator, ArrayRef<OpenedType> openedTypes);
44404414
4441- // / Undo the above change.
4442- void removeOpenedType (ConstraintLocator *locator);
4443-
44444415 // / Record the set of opened types for the given locator.
44454416 void recordOpenedTypes (
44464417 ConstraintLocatorBuilder locator,
@@ -4962,8 +4933,6 @@ class ConstraintSystem {
49624933 void recordResolvedOverload (ConstraintLocator *locator,
49634934 SelectedOverload choice);
49644935
4965- void removeResolvedOverload (ConstraintLocator *locator);
4966-
49674936 // / Resolve the given overload set to the given choice.
49684937 void resolveOverload (ConstraintLocator *locator, Type boundType,
49694938 OverloadChoice choice, DeclContext *useDC);
@@ -5253,6 +5222,10 @@ class ConstraintSystem {
52535222 TypeMatchOptions flags,
52545223 ConstraintLocatorBuilder locator);
52555224
5225+ // / Update ImplicitValueConversions and record a change in the trail.
5226+ void recordImplicitValueConversion (ConstraintLocator *locator,
5227+ ConversionRestrictionKind restriction);
5228+
52565229 // / Simplify a conversion constraint by applying the given
52575230 // / reduction rule, which is known to apply at the outermost level.
52585231 SolutionKind simplifyRestrictedConstraint (
@@ -5393,22 +5366,10 @@ class ConstraintSystem {
53935366 // / Record a particular disjunction choice and add a change to the trail.
53945367 void recordDisjunctionChoice (ConstraintLocator *locator, unsigned index);
53955368
5396- // / Undo the above change.
5397- void removeDisjunctionChoice (ConstraintLocator *locator) {
5398- bool erased = DisjunctionChoices.erase (locator);
5399- ASSERT (erased);
5400- }
5401-
54025369 // / Record applied disjunction and add a change to the trail.
54035370 void recordAppliedDisjunction (ConstraintLocator *locator,
54045371 FunctionType *type);
54055372
5406- // / Undo the above change.
5407- void removeAppliedDisjunction (ConstraintLocator *locator) {
5408- bool erased = AppliedDisjunctions.erase (locator);
5409- ASSERT (erased);
5410- }
5411-
54125373 // / Filter the set of disjunction terms, keeping only those where the
54135374 // / predicate returns \c true.
54145375 // /
0 commit comments