Skip to content

Commit 1139f87

Browse files
committed
Return expression types from the constraint system type map.
Switch ConstraintSystem::getType() to returning the type from the constraint system type map. For now, assert that these types equal the types in the expression nodes since we are still setting the expression node types in ConstraintSystem::setType().
1 parent e30afe9 commit 1139f87

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

lib/Sema/ConstraintSystem.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,16 +1287,10 @@ class ConstraintSystem {
12871287

12881288
/// Get the type for an expression.
12891289
Type getType(Expr *E) {
1290-
// FIXME: Ideally this would be enabled but there are currently
1291-
// cases where we ask for types that are not set.
1292-
1293-
// assert(ExprTypes.find(E) != ExprTypes.end() &&
1294-
// "Expected type to have been set!");
1295-
1296-
// FIXME: Temporary until all references to expression types are
1297-
// updated.
1298-
// return ExprTypes[E];
1299-
return E->getType();
1290+
assert(hasType(E) && "Expected type to have been set!");
1291+
assert(ExprTypes[E]->isEqual(E->getType()) &&
1292+
"Expected type in map to be the same type in expression!");
1293+
return ExprTypes[E];
13001294
}
13011295

13021296
/// Cache the type of the expression argument and return that same

0 commit comments

Comments
 (0)