Represent variability with small helper class rather than an enum.

This provides part of the basis for representing SOA width in terms
of variability, but there should be no functional changes in this
checkin.
This commit is contained in:
Matt Pharr
2012-03-05 08:49:56 -08:00
parent 3082ea4765
commit 8ef41dfd97
5 changed files with 240 additions and 167 deletions

View File

@@ -6250,7 +6250,7 @@ TypeCastExpr::TypeCheck() {
expr, pos);
return ::TypeCheck(tce);
}
type = toType = type->ResolveUnboundVariability(Type::Varying);
type = toType = type->ResolveUnboundVariability(Variability::Varying);
fromType = lDeconstifyType(fromType);
toType = lDeconstifyType(toType);
@@ -6718,7 +6718,7 @@ SizeOfExpr::SizeOfExpr(Expr *e, SourcePos p)
SizeOfExpr::SizeOfExpr(const Type *t, SourcePos p)
: Expr(p), expr(NULL), type(t) {
if (type->HasUnboundVariability())
type = type->ResolveUnboundVariability(Type::Varying);
type = type->ResolveUnboundVariability(Variability::Varying);
}
@@ -6884,7 +6884,7 @@ FunctionSymbolExpr::GetType() const {
}
return matchingFunc ?
new PointerType(matchingFunc->type, Type::Uniform, true) : NULL;
new PointerType(matchingFunc->type, Variability::Uniform, true) : NULL;
}
@@ -7439,7 +7439,7 @@ NewExpr::NewExpr(int typeQual, const Type *t, Expr *init, Expr *count,
isVarying = (typeQual == 0) || (typeQual & TYPEQUAL_VARYING);
if (allocType != NULL && allocType->HasUnboundVariability())
allocType = allocType->ResolveUnboundVariability(Type::Uniform);
allocType = allocType->ResolveUnboundVariability(Variability::Uniform);
}