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().
This commit is contained in:
Mark Lacey
2016-12-11 23:08:36 -07:00
parent e30afe9b96
commit 1139f8728e

View File

@@ -1287,16 +1287,10 @@ public:
/// Get the type for an expression. /// Get the type for an expression.
Type getType(Expr *E) { Type getType(Expr *E) {
// FIXME: Ideally this would be enabled but there are currently assert(hasType(E) && "Expected type to have been set!");
// cases where we ask for types that are not set. assert(ExprTypes[E]->isEqual(E->getType()) &&
"Expected type in map to be the same type in expression!");
// assert(ExprTypes.find(E) != ExprTypes.end() && return ExprTypes[E];
// "Expected type to have been set!");
// FIXME: Temporary until all references to expression types are
// updated.
// return ExprTypes[E];
return E->getType();
} }
/// Cache the type of the expression argument and return that same /// Cache the type of the expression argument and return that same