diff -r f9c4371d59d4 -r 7721042bdb67 src/compiler/HIR.h --- a/src/compiler/HIR.h Thu Dec 27 21:07:03 2012 -0800 +++ b/src/compiler/HIR.h Fri Dec 28 17:13:51 2012 -0800 @@ -34,6 +34,7 @@ _(Array) \ _(Store) \ _(ToRef) \ + _(NewDependentArray) \ /* Special LValue types */ \ _(Index) \ _(Local) \ @@ -306,6 +307,13 @@ void load(BytecodeEmitter &emitter_); bool ref(BytecodeEmitter &emitter_); + HIR *base() const { + return left_; + } + HIR *index() const { + return right_; + } + private: HIR *left_; HIR *right_; @@ -515,6 +523,30 @@ HIR *in_; }; +class HNewDependentArray : public HIR +{ + public: + HNewDependentArray(AstNode *node, Type *type, HIR *base, HIR *index) + : HIR(node, type), + base_(base), + index_(index) + { + } + + DEFINE_HIR(NewDependentArray); + + HIR *base() const { + return base_; + } + HIR *index() const { + return index_; + } + + private: + HIR *base_; + HIR *index_; +}; + #undef DEFINE_HIR void EmitHIR(Zone *zone, BytecodeEmitter &emitter, HIR *hir);