comparison dmd2/opover.c @ 1526:54b3c1394d62

Merged dmdfe 2.031.
author Robert Clipsham <robert@octarineparrot.com>
date Tue, 07 Jul 2009 02:26:11 +0100
parents 638d16625da2
children
comparison
equal deleted inserted replaced
1525:d28cd7c45267 1526:54b3c1394d62
196 // Rewrite +e1 as e1.add() 196 // Rewrite +e1 as e1.add()
197 return build_overload(loc, sc, e1, NULL, fd->ident); 197 return build_overload(loc, sc, e1, NULL, fd->ident);
198 } 198 }
199 } 199 }
200 200
201 #if DMDV2
201 // Didn't find it. Forward to aliasthis 202 // Didn't find it. Forward to aliasthis
202 if (ad->aliasthis) 203 if (ad->aliasthis)
203 { 204 {
204 /* Rewrite op(e1) as: 205 /* Rewrite op(e1) as:
205 * op(e1.aliasthis) 206 * op(e1.aliasthis)
208 Expression *e = copy(); 209 Expression *e = copy();
209 ((UnaExp *)e)->e1 = e1; 210 ((UnaExp *)e)->e1 = e1;
210 e = e->semantic(sc); 211 e = e->semantic(sc);
211 return e; 212 return e;
212 } 213 }
214 #endif
213 } 215 }
214 return NULL; 216 return NULL;
215 } 217 }
216 218
217 219
439 441
440 return e; 442 return e;
441 } 443 }
442 } 444 }
443 445
446 #if DMDV2
444 // Try alias this on first operand 447 // Try alias this on first operand
445 if (ad1 && ad1->aliasthis) 448 if (ad1 && ad1->aliasthis)
446 { 449 {
447 /* Rewrite (e1 op e2) as: 450 /* Rewrite (e1 op e2) as:
448 * (e1.aliasthis op e2) 451 * (e1.aliasthis op e2)
464 Expression *e = copy(); 467 Expression *e = copy();
465 ((BinExp *)e)->e2 = e2; 468 ((BinExp *)e)->e2 = e2;
466 e = e->semantic(sc); 469 e = e->semantic(sc);
467 return e; 470 return e;
468 } 471 }
469 472 #endif
470 return NULL; 473 return NULL;
471 } 474 }
472 475
473 /*********************************** 476 /***********************************
474 * Utility to build a function call out of this reference and argument. 477 * Utility to build a function call out of this reference and argument.