1.1 --- a/src/compiler/HIR.h Sat Dec 22 23:18:57 2012 -0800
1.2 +++ b/src/compiler/HIR.h Mon Dec 24 02:49:20 2012 -0800
1.3 @@ -29,6 +29,8 @@
1.4 _(Call) \
1.5 _(Integer) \
1.6 _(Float) \
1.7 + _(String) \
1.8 + _(Array) \
1.9 _(Store) \
1.10 _(ToRef) \
1.11 /* Special LValue types */ \
1.12 @@ -48,6 +50,7 @@
1.13 class HIRVisitor;
1.14 class AstNode;
1.15 class HLValue;
1.16 +class Array;
1.17
1.18 class HIR : public PoolObject
1.19 {
1.20 @@ -142,6 +145,42 @@
1.21 int value_;
1.22 };
1.23
1.24 +class HString : public HIR
1.25 +{
1.26 + public:
1.27 + HString(AstNode *node, Type *type, String *string)
1.28 + : HIR(node, type),
1.29 + string_(string)
1.30 + {
1.31 + }
1.32 +
1.33 + DEFINE_HIR(String);
1.34 + Handle<String> string() const {
1.35 + return string_;
1.36 + }
1.37 +
1.38 + private:
1.39 + ScopedRoot<String> string_;
1.40 +};
1.41 +
1.42 +class HArray : public HIR
1.43 +{
1.44 + public:
1.45 + HArray(AstNode *node, Type *type, Array *array)
1.46 + : HIR(node, type),
1.47 + array_(array)
1.48 + {
1.49 + }
1.50 +
1.51 + DEFINE_HIR(Array);
1.52 + Handle<Array> array() const {
1.53 + return array_;
1.54 + }
1.55 +
1.56 + private:
1.57 + ScopedRoot<Array> array_;
1.58 +};
1.59 +
1.60 class HConvert : public HIR
1.61 {
1.62 public: