Add support for enums.

This commit is contained in:
Matt Pharr
2011-07-17 16:43:05 +02:00
parent 17e5c8b7c2
commit f0f876c3ec
23 changed files with 1031 additions and 251 deletions

11
expr.h
View File

@@ -39,6 +39,7 @@
#define ISPC_EXPR_H 1
#include "ispc.h"
#include "type.h"
class FunctionSymbolExpr;
@@ -318,9 +319,9 @@ private:
/** @brief Expression representing a compile-time constant value.
This class can currently represent compile-time constants of anything
that is an AtomicType; for anything more complex, we don't currently
have a representation of a compile-time constant that can be further
reasoned about.
that is an AtomicType or an EnumType; for anything more complex, we
don't currently have a representation of a compile-time constant that
can be further reasoned about.
*/
class ConstExpr : public Expr {
public:
@@ -412,7 +413,9 @@ public:
int Count() const;
private:
const AtomicType *type;
AtomicType::BasicType getBasicType() const;
const Type *type;
union {
int32_t int32Val[ISPC_MAX_NVEC];
uint32_t uint32Val[ISPC_MAX_NVEC];