comparison dmd/codegen/Util.d @ 73:ef02e2e203c2

Updating to dmd2.033
author korDen
date Sat, 28 Aug 2010 19:42:41 +0400
parents f708f0452e81
children 7e0d548de9e6
comparison
equal deleted inserted replaced
72:2e2a5c3f943a 73:ef02e2e203c2
1 module dmd.codegen.Util; 1 module dmd.codegen.Util;
2 2
3 import dmd.Loc; 3 import dmd.Loc;
4 import dmd.Id;
4 import dmd.IRState; 5 import dmd.IRState;
5 import dmd.Type; 6 import dmd.Type;
6 import dmd.Array; 7 import dmd.Array;
7 import dmd.Dsymbol; 8 import dmd.Dsymbol;
8 import dmd.FuncDeclaration; 9 import dmd.FuncDeclaration;
349 elem* ethis; 350 elem* ethis;
350 FuncDeclaration thisfd = irs.getFunc(); 351 FuncDeclaration thisfd = irs.getFunc();
351 Dsymbol fdparent = fd.toParent2(); 352 Dsymbol fdparent = fd.toParent2();
352 353
353 //printf("getEthis(thisfd = '%s', fd = '%s', fdparent = '%s')\n", thisfd.toChars(), fd.toChars(), fdparent.toChars()); 354 //printf("getEthis(thisfd = '%s', fd = '%s', fdparent = '%s')\n", thisfd.toChars(), fd.toChars(), fdparent.toChars());
354 if (fdparent == thisfd) 355 if (fdparent == thisfd ||
356 /* These two are compiler generated functions for the in and out contracts,
357 * and are called from an overriding function, not just the one they're
358 * nested inside, so this hack is so they'll pass
359 */
360 fd.ident == Id.require || fd.ident == Id.ensure)
355 { 361 {
356 /* Going down one nesting level, i.e. we're calling 362 /* Going down one nesting level, i.e. we're calling
357 * a nested function from its enclosing function. 363 * a nested function from its enclosing function.
358 */ 364 */
359 ///version (DMDV2) { 365 ///version (DMDV2) {
403 * the value of EBP 409 * the value of EBP
404 */ 410 */
405 ethis.Eoper = OPER.OPframeptr; 411 ethis.Eoper = OPER.OPframeptr;
406 } 412 }
407 } 413 }
414
415 //if (fdparent != thisfd) ethis = el_bin(OPadd, TYnptr, ethis, el_long(TYint, 0x18));
408 } 416 }
409 else 417 else
410 { 418 {
411 if (!irs.sthis) // if no frame pointer for this function 419 if (!irs.sthis) // if no frame pointer for this function
412 { 420 {