@@ -917,7 +917,7 @@ class Solution {
917
917
llvm::MapVector<TypedNode, Type> nodeTypes;
918
918
919
919
// / Contextual types introduced by this solution.
920
- std::vector<std::pair<const Expr * , ContextualTypeInfo>> contextualTypes;
920
+ std::vector<std::pair<TypedNode , ContextualTypeInfo>> contextualTypes;
921
921
922
922
// / Maps AST nodes to their solution application targets.
923
923
llvm::MapVector<SolutionApplicationTargetsKey, SolutionApplicationTarget>
@@ -1719,7 +1719,7 @@ class ConstraintSystem {
1719
1719
1720
1720
// / Contextual type information for expressions that are part of this
1721
1721
// / constraint system.
1722
- llvm::MapVector<const Expr * , ContextualTypeInfo> contextualTypes;
1722
+ llvm::MapVector<TypedNode , ContextualTypeInfo> contextualTypes;
1723
1723
1724
1724
// / Information about each case label item tracked by the constraint system.
1725
1725
llvm::SmallMapVector<const CaseLabelItem *, CaseLabelItemInfo, 4 >
@@ -2527,37 +2527,37 @@ class ConstraintSystem {
2527
2527
return E;
2528
2528
}
2529
2529
2530
- void setContextualType (
2531
- const Expr *expr, TypeLoc T, ContextualTypePurpose purpose) {
2532
- assert (expr != nullptr && " Expected non-null expression!" );
2533
- assert (contextualTypes.count (expr ) == 0 &&
2530
+ void setContextualType (TypedNode node, TypeLoc T,
2531
+ ContextualTypePurpose purpose) {
2532
+ assert (bool (node) && " Expected non-null expression!" );
2533
+ assert (contextualTypes.count (node ) == 0 &&
2534
2534
" Already set this contextual type" );
2535
- contextualTypes[expr ] = { T, purpose };
2535
+ contextualTypes[node ] = {T, purpose};
2536
2536
}
2537
2537
2538
- Optional<ContextualTypeInfo> getContextualTypeInfo (const Expr *expr ) const {
2539
- auto known = contextualTypes.find (expr );
2538
+ Optional<ContextualTypeInfo> getContextualTypeInfo (TypedNode node ) const {
2539
+ auto known = contextualTypes.find (node );
2540
2540
if (known == contextualTypes.end ())
2541
2541
return None;
2542
2542
return known->second ;
2543
2543
}
2544
2544
2545
- Type getContextualType (const Expr *expr ) const {
2546
- auto result = getContextualTypeInfo (expr );
2545
+ Type getContextualType (TypedNode node ) const {
2546
+ auto result = getContextualTypeInfo (node );
2547
2547
if (result)
2548
2548
return result->typeLoc .getType ();
2549
2549
return Type ();
2550
2550
}
2551
2551
2552
- TypeLoc getContextualTypeLoc (const Expr *expr ) const {
2553
- auto result = getContextualTypeInfo (expr );
2552
+ TypeLoc getContextualTypeLoc (TypedNode node ) const {
2553
+ auto result = getContextualTypeInfo (node );
2554
2554
if (result)
2555
2555
return result->typeLoc ;
2556
2556
return TypeLoc ();
2557
2557
}
2558
2558
2559
- ContextualTypePurpose getContextualTypePurpose (const Expr *expr ) const {
2560
- auto result = getContextualTypeInfo (expr );
2559
+ ContextualTypePurpose getContextualTypePurpose (TypedNode node ) const {
2560
+ auto result = getContextualTypeInfo (node );
2561
2561
if (result)
2562
2562
return result->purpose ;
2563
2563
return CTP_Unused;
0 commit comments