[WIP] Add quantifier to polymorphic types

This commit is contained in:
2017-04-28 14:04:26 -04:00
parent 108c9c6fb5
commit 259f092143
2 changed files with 39 additions and 9 deletions

9
type.h
View File

@@ -368,6 +368,7 @@ private:
class PolyType : public Type {
public:
Variability GetVariability() const;
int GetQuant() const;
bool IsBoolType() const;
bool IsFloatType() const;
@@ -1064,6 +1065,14 @@ CastType(const Type *type) {
return NULL;
}
template <> inline const PolyType *
CastType(const Type *type) {
if (type != NULL && type->typeId == POLY_TYPE)
return (const PolyType *)type;
else
return NULL;
}
template <> inline const EnumType *
CastType(const Type *type) {
if (type != NULL && type->typeId == ENUM_TYPE)