Mercurial > projects > ldc
diff gen/dvalue.h @ 359:926f65e39246 trunk
[svn r380] Improve complex number support.
author | ChristianK |
---|---|
date | Mon, 14 Jul 2008 17:22:43 +0200 |
parents | 6057fdf797d8 |
children | 932229a851a4 |
line wrap: on
line diff
--- a/gen/dvalue.h Mon Jul 14 12:39:23 2008 +0200 +++ b/gen/dvalue.h Mon Jul 14 17:22:43 2008 +0200 @@ -169,24 +169,20 @@ // l-value and r-value pair d-value struct DLRValue : DValue { - Type* ltype; - LLValue* lval; - Type* rtype; - LLValue* rval; + DValue* lvalue; + DValue* rvalue; - DLRValue(Type* lt, LLValue* l, Type* rt, LLValue* r) { - ltype = lt; - lval = l; - rtype = rt; - rval = r; + DLRValue(DValue* lval, DValue* rval) { + lvalue = lval; + rvalue = rval; } - virtual bool isLVal() { return lval; } - virtual LLValue* getLVal() { assert(lval); return lval; } - virtual LLValue* getRVal() { assert(rval); return rval; } + virtual bool isLVal() { return true; } + virtual LLValue* getLVal() { return lvalue->isLVal() ? lvalue->getLVal() : lvalue->getRVal(); } + virtual LLValue* getRVal() { return rvalue->getRVal(); } - Type* getLType() { return ltype; } - Type* getRType() { return rtype; } + Type* getLType() { return lvalue->getType(); } + Type* getRType() { return rvalue->getType(); } virtual Type* getType() { return getRType(); } virtual DLRValue* isLRValue() { return this; } };