Mercurial > projects > ddmd
diff dmd/EqualExp.d @ 130:60bb0fe4563e
dmdfe 2.037 first main iteration
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Thu, 09 Sep 2010 22:51:44 +0100 |
parents | 6caaf0256da1 |
children | e3afd1303184 |
line wrap: on
line diff
--- a/dmd/EqualExp.d Sun Sep 05 15:32:22 2010 +0400 +++ b/dmd/EqualExp.d Thu Sep 09 22:51:44 2010 +0100 @@ -181,21 +181,13 @@ //printf("EqualExp::toElem()\n"); if (t1.ty == Tstruct) { // Do bit compare of struct's - elem* es1; - elem* es2; - elem* ecount; - es1 = e1.toElem(irs); - es2 = e2.toElem(irs); - static if (true) { + auto es1 = e1.toElem(irs); + auto es2 = e2.toElem(irs); es1 = addressElem(es1, t1); es2 = addressElem(es2, t2); - } else { - es1 = el_una(OPaddr, TYnptr, es1); - es2 = el_una(OPaddr, TYnptr, es2); - } e = el_param(es1, es2); - ecount = el_long(TYint, t1.size()); + auto ecount = el_long(TYint, t1.size()); e = el_bin(OPmemcmp, TYint, e, ecount); e = el_bin(eop, TYint, e, el_long(TYint, 0)); el_setLoc(e,loc); @@ -214,24 +206,20 @@ else if ((t1.ty == Tarray || t1.ty == Tsarray) && (t2.ty == Tarray || t2.ty == Tsarray)) { - elem* ea1; - elem* ea2; - elem* ep; Type telement = t1.nextOf().toBasetype(); - int rtlfunc; - ea1 = e1.toElem(irs); + auto ea1 = e1.toElem(irs); ea1 = array_toDarray(t1, ea1); - ea2 = e2.toElem(irs); + auto ea2 = e2.toElem(irs); ea2 = array_toDarray(t2, ea2); version (DMDV2) { - ep = el_params(telement.arrayOf().getInternalTypeInfo(null).toElem(irs), + auto ep = el_params(telement.arrayOf().getInternalTypeInfo(null).toElem(irs), ea2, ea1, null); - rtlfunc = RTLSYM_ARRAYEQ2; + int rtlfunc = RTLSYM_ARRAYEQ2; } else { - ep = el_params(telement.getInternalTypeInfo(null).toElem(irs), ea2, ea1, null); - rtlfunc = RTLSYM_ARRAYEQ; + auto ep = el_params(telement.getInternalTypeInfo(null).toElem(irs), ea2, ea1, null); + int rtlfunc = RTLSYM_ARRAYEQ; } e = el_bin(OPcall, TYint, el_var(rtlsym[rtlfunc]), ep); if (op == TOKnotequal)