Skip to content

Commit 8203b43

Browse files
author
Amritpan Kaur
committed
[ConstraintSystem] Track keypath root, value, declcontext
for each keypath expression for constraint system.
1 parent e240ec5 commit 8203b43

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,6 +1489,13 @@ class Solution {
14891489
llvm::DenseMap<std::pair<const KeyPathExpr *, unsigned>, Type>
14901490
keyPathComponentTypes;
14911491

1492+
/// The key path expression and its root type, value type, and decl context
1493+
/// introduced by this solution.
1494+
llvm::MapVector<const KeyPathExpr *,
1495+
std::tuple</*root=*/TypeVariableType *,
1496+
/*value=*/TypeVariableType *, DeclContext *>>
1497+
KeyPaths;
1498+
14921499
/// Contextual types introduced by this solution.
14931500
std::vector<std::pair<ASTNode, ContextualTypeInfo>> contextualTypes;
14941501

@@ -2154,6 +2161,12 @@ class ConstraintSystem {
21542161
std::tuple<const KeyPathExpr *, /*component index=*/unsigned, Type>>
21552162
addedKeyPathComponentTypes;
21562163

2164+
/// Maps a key path root, value, and decl context to the key path expression.
2165+
llvm::MapVector<const KeyPathExpr *,
2166+
std::tuple</*root=*/TypeVariableType *,
2167+
/*value=*/TypeVariableType *, DeclContext *>>
2168+
KeyPaths;
2169+
21572170
/// Maps AST entries to their targets.
21582171
llvm::MapVector<SyntacticElementTargetKey, SyntacticElementTarget> targets;
21592172

@@ -2780,6 +2793,9 @@ class ConstraintSystem {
27802793
/// The length of \c ImplicitValueConversions.
27812794
unsigned numImplicitValueConversions;
27822795

2796+
/// The length of \c KeyPaths.
2797+
unsigned numKeyPaths;
2798+
27832799
/// The length of \c ArgumentLists.
27842800
unsigned numArgumentLists;
27852801

0 commit comments

Comments
 (0)