Mercurial > projects > ldc
diff gen/dvalue.h @ 334:20446d22f832 trunk
[svn r355] Get rid of IRState::exps and topexp.
author | ChristianK |
---|---|
date | Sat, 12 Jul 2008 15:43:13 +0200 |
parents | 7816aafeea3c |
children | 17b844102023 |
line wrap: on
line diff
--- a/gen/dvalue.h Sat Jul 12 09:23:14 2008 +0200 +++ b/gen/dvalue.h Sat Jul 12 15:43:13 2008 +0200 @@ -42,6 +42,8 @@ virtual LLValue* getLVal() { assert(0); return 0; } virtual LLValue* getRVal() { assert(0); return 0; } + virtual bool isLVal() { return false; } + virtual DImValue* isIm() { return NULL; } virtual DConstValue* isConst() { return NULL; } virtual DNullValue* isNull() { return NULL; } @@ -113,6 +115,7 @@ DVarValue(Type* vd, LLValue* lv, LLValue* rv); DVarValue(Type* t, LLValue* llvmValue, bool lvalue); + virtual bool isLVal() { return val && lval; } virtual LLValue* getLVal(); virtual LLValue* getRVal(); @@ -134,13 +137,6 @@ virtual DThisValue* isThis() { return this; } }; -// array length d-value -struct DArrayLenValue : DVarValue -{ - DArrayLenValue(Type* t, LLValue* llvmValue) : DVarValue(t, llvmValue, true) {} - virtual DArrayLenValue* isArrayLen() { return this; } -}; - // slice d-value struct DSliceValue : DValue { @@ -165,7 +161,6 @@ DFuncValue(FuncDeclaration* fd, LLValue* v, LLValue* vt = 0); - virtual LLValue* getLVal(); virtual LLValue* getRVal(); virtual Type* getType() { assert(type); return type; } @@ -187,6 +182,7 @@ rval = r; } + virtual bool isLVal() { return lval; } virtual LLValue* getLVal() { assert(lval); return lval; } virtual LLValue* getRVal() { assert(rval); return rval; } @@ -196,6 +192,13 @@ virtual DLRValue* isLRValue() { return this; } }; +// array length d-value +struct DArrayLenValue : DLRValue +{ + DArrayLenValue(Type* lt, LLValue* l, Type* rt, LLValue* r) : DLRValue(lt, l, rt, r) {} + virtual DArrayLenValue* isArrayLen() { return this; } +}; + // complex number immediate d-value (much like slice) struct DComplexValue : DValue {