Mercurial > projects > ddmd
view dmd/BoolExp.d @ 36:3012e829306f
bad code translation bugs fixed
author | korDen |
---|---|
date | Sat, 21 Aug 2010 06:55:28 +0400 |
parents | 10317f0c89a5 |
children | cab4c37afb89 |
line wrap: on
line source
module dmd.BoolExp; import dmd.Expression; import dmd.backend.elem; import dmd.UnaExp; import dmd.InterState; import dmd.Type; import dmd.Loc; import dmd.Scope; import dmd.IRState; import dmd.TOK; import dmd.backend.OPER; import dmd.backend.Util; class BoolExp : UnaExp { this(Loc loc, Expression e, Type t) { super(loc, TOKtobool, BoolExp.sizeof, e); type = t; } Expression semantic(Scope sc) { UnaExp.semantic(sc); e1 = resolveProperties(sc, e1); e1 = e1.checkToBoolean(); type = Type.tboolean; return this; } Expression optimize(int result) { assert(false); } Expression interpret(InterState* istate) { assert(false); } int isBit() { return true; } elem* toElem(IRState* irs) { elem* e1 = this.e1.toElem(irs); return el_una(OPbool,type.totym(),e1); } }