@@ -906,7 +906,7 @@ class ConstraintSystem {
906
906
// / nodes themselves. This allows us to typecheck an expression and
907
907
// / run through various diagnostics passes without actually mutating
908
908
// / the types on the expression nodes.
909
- llvm::DenseMap<Expr *, TypeBase *> ExprTypes;
909
+ llvm::DenseMap<const Expr *, TypeBase *> ExprTypes;
910
910
911
911
// / There can only be a single contextual type on the root of the expression
912
912
// / being checked. If specified, this holds its type along with the base
@@ -1388,16 +1388,16 @@ class ConstraintSystem {
1388
1388
}
1389
1389
1390
1390
// / Check to see if we have a type for an expression.
1391
- bool hasType (Expr *E) {
1391
+ bool hasType (const Expr *E) const {
1392
1392
return ExprTypes.find (E) != ExprTypes.end ();
1393
1393
}
1394
1394
1395
1395
// / Get the type for an expression.
1396
- Type getType (Expr *E) {
1396
+ Type getType (const Expr *E) const {
1397
1397
assert (hasType (E) && " Expected type to have been set!" );
1398
- assert (ExprTypes[E] ->isEqual (E->getType ()) &&
1398
+ assert (ExprTypes. find (E)-> second ->isEqual (E->getType ()) &&
1399
1399
" Expected type in map to be the same type in expression!" );
1400
- return ExprTypes[E] ;
1400
+ return ExprTypes. find (E)-> second ;
1401
1401
}
1402
1402
1403
1403
// / Cache the type of the expression argument and return that same
0 commit comments