@@ -1519,7 +1519,7 @@ class Solution {
15191519
15201520 // / For locators associated with call expressions, the trailing closure
15211521 // / matching rule and parameter bindings that were applied.
1522- llvm::MapVector <ConstraintLocator *, MatchCallArgumentResult>
1522+ llvm::DenseMap <ConstraintLocator *, MatchCallArgumentResult>
15231523 argumentMatchingChoices;
15241524
15251525 // / The set of disjunction choices used to arrive at this solution,
@@ -2341,7 +2341,7 @@ class ConstraintSystem {
23412341
23422342 // / For locators associated with call expressions, the trailing closure
23432343 // / matching rule and parameter bindings that were applied.
2344- llvm::MapVector <ConstraintLocator *, MatchCallArgumentResult>
2344+ llvm::DenseMap <ConstraintLocator *, MatchCallArgumentResult>
23452345 argumentMatchingChoices;
23462346
23472347 // / The set of implicit value conversions performed by the solver on
@@ -2883,9 +2883,6 @@ class ConstraintSystem {
28832883 // / FIXME: Remove this.
28842884 unsigned numFixes;
28852885
2886- // / The length of \c argumentMatchingChoices.
2887- unsigned numArgumentMatchingChoices;
2888-
28892886 // / The length of \c OpenedTypes.
28902887 unsigned numOpenedTypes;
28912888
@@ -3637,9 +3634,16 @@ class ConstraintSystem {
36373634 // / \param type The type on which to holeify.
36383635 void recordTypeVariablesAsHoles (Type type);
36393636
3637+ // / Add a MatchCallArgumentResult and record the change in the trail.
36403638 void recordMatchCallArgumentResult (ConstraintLocator *locator,
36413639 MatchCallArgumentResult result);
36423640
3641+ // / Undo the above change.
3642+ void removeMatchCallArgumentResult (ConstraintLocator *locator) {
3643+ bool erased = argumentMatchingChoices.erase (locator);
3644+ ASSERT (erased);
3645+ }
3646+
36433647 // / Record implicitly generated `callAsFunction` with root at the
36443648 // / given expression, located at \c locator.
36453649 void recordCallAsFunction (UnresolvedDotExpr *root, ArgumentList *arguments,
0 commit comments