@@ -1567,9 +1567,9 @@ class Solution {
15671567
15681568 // / The key path expression and its root type, value type, and decl context
15691569 // / introduced by this solution.
1570- llvm::MapVector <const KeyPathExpr *,
1571- std::tuple</* root=*/ TypeVariableType *,
1572- /* value=*/ TypeVariableType *, DeclContext *>>
1570+ llvm::DenseMap <const KeyPathExpr *,
1571+ std::tuple</* root=*/ TypeVariableType *,
1572+ /* value=*/ TypeVariableType *, DeclContext *>>
15731573 KeyPaths;
15741574
15751575 // / Contextual types introduced by this solution.
@@ -2265,9 +2265,9 @@ class ConstraintSystem {
22652265 KeyPathComponentTypes;
22662266
22672267 // / Maps a key path root, value, and decl context to the key path expression.
2268- llvm::MapVector <const KeyPathExpr *,
2269- std::tuple</* root=*/ TypeVariableType *,
2270- /* value=*/ TypeVariableType *, DeclContext *>>
2268+ llvm::DenseMap <const KeyPathExpr *,
2269+ std::tuple</* root=*/ TypeVariableType *,
2270+ /* value=*/ TypeVariableType *, DeclContext *>>
22712271 KeyPaths;
22722272
22732273 // / Maps AST entries to their targets.
@@ -2850,9 +2850,6 @@ class ConstraintSystem {
28502850 // / FIXME: Remove this.
28512851 unsigned numFixes;
28522852
2853- // / The length of \c KeyPaths.
2854- unsigned numKeyPaths;
2855-
28562853 // / The length of \c ArgumentLists.
28572854 unsigned numArgumentLists;
28582855
@@ -3641,10 +3638,13 @@ class ConstraintSystem {
36413638 ConstraintLocator *locator);
36423639
36433640 // / Record root, value, and declContext of keypath expression for use across
3644- // / constraint system.
3645- void recordKeyPath (KeyPathExpr *keypath, TypeVariableType *root,
3641+ // / constraint system, and add a change to the trail .
3642+ void recordKeyPath (const KeyPathExpr *keypath, TypeVariableType *root,
36463643 TypeVariableType *value, DeclContext *dc);
36473644
3645+ // / Undo the above change.
3646+ void removeKeyPath (const KeyPathExpr *keypath);
3647+
36483648 // / Walk a closure AST to determine its effects.
36493649 // /
36503650 // / \returns a function's extended info describing the effects, as
0 commit comments