Changeset 380
- Timestamp:
- 02/12/10 04:35:06 (7 months ago)
- Files:
-
- branches/dmd-1.x/src/backend/blockopt.c (modified) (3 diffs)
- branches/dmd-1.x/src/backend/cgelem.c (modified) (2 diffs)
- trunk/src/backend/blockopt.c (modified) (3 diffs)
- trunk/src/backend/cgelem.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/dmd-1.x/src/backend/blockopt.c
r288 r380 1 1 // Copyright (C) 1986-1997 by Symantec 2 // Copyright (C) 2000-20 09by Digital Mars2 // Copyright (C) 2000-2010 by Digital Mars 3 3 // All Rights Reserved 4 4 // http://www.digitalmars.com 5 5 // Written by Walter Bright 6 6 /* 7 7 * This source file is made available for personal use … … 735 735 //|| (bc2 == BCret && b3->BC == BCret) 736 736 ) 737 737 { elem *e; 738 738 739 739 if (PARSER) 740 { type *t; 741 742 t = (bc2 == BCretexp) ? b2->Belem->ET : tsvoid; 740 { 741 type *t = (bc2 == BCretexp) ? b2->Belem->ET : tsvoid; 743 742 e = el_bint(OPcolon2,t,b2->Belem,b3->Belem); 744 743 b->Belem = el_bint(OPcond,t,b->Belem,e); 745 744 } 746 745 else 747 { tym_t ty; 748 746 { 749 747 if (EOP(b3->Belem)) 750 748 continue; 751 ty = (bc2 == BCretexp) ? b2->Belem->Ety : TYvoid;749 tym_t ty = (bc2 == BCretexp) ? b2->Belem->Ety : TYvoid; 752 750 e = el_bin(OPcolon2,ty,b2->Belem,b3->Belem); 753 751 b->Belem = el_bin(OPcond,ty,b->Belem,e); 754 752 } 755 753 b->BC = bc2; 754 b->Belem->Enumbytes = b2->Belem->Enumbytes; 756 755 b2->Belem = NULL; 757 756 b3->Belem = NULL; 758 757 list_free(&b->Bsucc,FPNULL); 759 758 list_subtract(&(b2->Bpred),b); 760 759 list_subtract(&(b3->Bpred),b); … … 791 790 if (EOP(b3->Belem)) 792 791 continue; 793 792 e = el_bin(OPcolon2,b2->Belem->Ety, 794 793 b2->Belem,b3->Belem); 795 794 e = el_bin(OPcond,e->Ety,b->Belem,e); 795 e->Enumbytes = b2->Belem->Enumbytes; 796 796 } 797 797 else 798 798 { 799 799 op = OPandand; 800 800 e = el_bin(op,TYint,b->Belem,b2->Belem); branches/dmd-1.x/src/backend/cgelem.c
r289 r380 1 1 // Copyright (C) 1985-1998 by Symantec 2 // Copyright (C) 2000-20 09by Digital Mars2 // Copyright (C) 2000-2010 by Digital Mars 3 3 // All Rights Reserved 4 4 // http://www.digitalmars.com 5 5 // Written by Walter Bright 6 6 /* 7 7 * This source file is made available for personal use … … 4372 4372 4373 4373 if (!OTrtol(op) && op != OPparam && op != OPcolon && op != OPcolon2 && 4374 4374 e1->Eoper == OPcomma) 4375 4375 { // Convert ((a,b) op c) to (a,(b op c)) 4376 4376 e1->Ety = e->Ety; 4377 e1->Enumbytes = e->Enumbytes; 4377 4378 e->E1 = e1->E2; 4378 4379 e1->E2 = e; 4379 4380 e = e1; 4380 4381 goto beg; 4381 4382 } trunk/src/backend/blockopt.c
r288 r380 1 1 // Copyright (C) 1986-1997 by Symantec 2 // Copyright (C) 2000-20 09by Digital Mars2 // Copyright (C) 2000-2010 by Digital Mars 3 3 // All Rights Reserved 4 4 // http://www.digitalmars.com 5 5 // Written by Walter Bright 6 6 /* 7 7 * This source file is made available for personal use … … 735 735 //|| (bc2 == BCret && b3->BC == BCret) 736 736 ) 737 737 { elem *e; 738 738 739 739 if (PARSER) 740 { type *t; 741 742 t = (bc2 == BCretexp) ? b2->Belem->ET : tsvoid; 740 { 741 type *t = (bc2 == BCretexp) ? b2->Belem->ET : tsvoid; 743 742 e = el_bint(OPcolon2,t,b2->Belem,b3->Belem); 744 743 b->Belem = el_bint(OPcond,t,b->Belem,e); 745 744 } 746 745 else 747 { tym_t ty; 748 746 { 749 747 if (EOP(b3->Belem)) 750 748 continue; 751 ty = (bc2 == BCretexp) ? b2->Belem->Ety : TYvoid;749 tym_t ty = (bc2 == BCretexp) ? b2->Belem->Ety : TYvoid; 752 750 e = el_bin(OPcolon2,ty,b2->Belem,b3->Belem); 753 751 b->Belem = el_bin(OPcond,ty,b->Belem,e); 754 752 } 755 753 b->BC = bc2; 754 b->Belem->Enumbytes = b2->Belem->Enumbytes; 756 755 b2->Belem = NULL; 757 756 b3->Belem = NULL; 758 757 list_free(&b->Bsucc,FPNULL); 759 758 list_subtract(&(b2->Bpred),b); 760 759 list_subtract(&(b3->Bpred),b); … … 791 790 if (EOP(b3->Belem)) 792 791 continue; 793 792 e = el_bin(OPcolon2,b2->Belem->Ety, 794 793 b2->Belem,b3->Belem); 795 794 e = el_bin(OPcond,e->Ety,b->Belem,e); 795 e->Enumbytes = b2->Belem->Enumbytes; 796 796 } 797 797 else 798 798 { 799 799 op = OPandand; 800 800 e = el_bin(op,TYint,b->Belem,b2->Belem); trunk/src/backend/cgelem.c
r289 r380 1 1 // Copyright (C) 1985-1998 by Symantec 2 // Copyright (C) 2000-20 09by Digital Mars2 // Copyright (C) 2000-2010 by Digital Mars 3 3 // All Rights Reserved 4 4 // http://www.digitalmars.com 5 5 // Written by Walter Bright 6 6 /* 7 7 * This source file is made available for personal use … … 4372 4372 4373 4373 if (!OTrtol(op) && op != OPparam && op != OPcolon && op != OPcolon2 && 4374 4374 e1->Eoper == OPcomma) 4375 4375 { // Convert ((a,b) op c) to (a,(b op c)) 4376 4376 e1->Ety = e->Ety; 4377 e1->Enumbytes = e->Enumbytes; 4377 4378 e->E1 = e1->E2; 4378 4379 e1->E2 = e; 4379 4380 e = e1; 4380 4381 goto beg; 4381 4382 }
