Implementing a VectorCoerceExpr.

Turns out we didn't have that yet.

I don't remember who implemented vectors originally, but he does owe
us all round at Jupiter ...
This commit is contained in:
Robin Sommer 2011-04-19 16:58:18 -07:00
parent b3b5a73113
commit 5a6311d360
7 changed files with 115 additions and 6 deletions

View file

@ -40,7 +40,7 @@ typedef enum {
EXPR_CALL,
EXPR_EVENT,
EXPR_SCHEDULE,
EXPR_ARITH_COERCE, EXPR_RECORD_COERCE, EXPR_TABLE_COERCE,
EXPR_ARITH_COERCE, EXPR_RECORD_COERCE, EXPR_TABLE_COERCE, EXPR_VECTOR_COERCE,
EXPR_SIZE,
EXPR_FLATTEN,
#define NUM_EXPRS (int(EXPR_FLATTEN) + 1)
@ -895,6 +895,20 @@ protected:
DECLARE_SERIAL(TableCoerceExpr);
};
class VectorCoerceExpr : public UnaryExpr {
public:
VectorCoerceExpr(Expr* op, VectorType* v);
~VectorCoerceExpr();
protected:
friend class Expr;
VectorCoerceExpr() { }
Val* Fold(Val* v) const;
DECLARE_SERIAL(VectorCoerceExpr);
};
// An internal operator for flattening array indices that are records
// into a list of individual values.
class FlattenExpr : public UnaryExpr {