Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.129
 
1.130
 
MAIN:ragge:20050522135501
 
reader.c
_>141141 }
 142142 #endif
 143143 
<>144 -/* look for delayable ++ and -- operators */
  144+/*
  145+ * See if post-decrement and post-increment operators can be delayed
  146+ * past this statement.  This is only possible if it do not end up
  147+ * after a function call.
  148+ * There may be instructions that will do post-in/decrement, therefore
  149+ * call special routines to check if we can do this.
  150+ */
145151 void
 146152 delay(NODE *p)
 147153 {
     
 !
217223         }
 218224 }
 219225 
<> 226+/*
  227+ * Delete statements with no meaning (like a+b; or 513.4;)
  228+ */
220229 static NODE *
 221230 deluseless(NODE *p)
 222231 {
     
 !
674683 NODE *
 675684 store(NODE *p)
 676685 {
<>677 -        NODE *q, *r, *s;
  686+        extern struct interpass *storesave;
  687+        struct interpass *ip;
  688+        NODE *q, *r;
  689+        int s;
678690 
<>679 -        q = talloc();
 680 -        r = talloc();
 681 -        s = talloc();
 682 -        q->n_op = OREG;
 683 -        q->n_type = p->n_type;
 684 -        q->n_name = "";
 685 -        q->n_rval = FPREG;
 686 -        q->n_lval = BITOOR(freetemp(szty(p->n_type)));
 687 -        *r = *q;
 688 -        s->n_op = ASSIGN;
 689 -        s->n_type = p->n_type;
 690 -        s->n_name = "";
 691 -        s->n_left = q;
 692 -        s->n_right = p;
 693 -        if (xsaveip) {
 694 -                extern struct interpass *storesave;
 695 -                storesave = ipnode(s);
 696 -        } else
 697 -                emit(ipnode(s));
  691+        s = BITOOR(freetemp(szty(p->n_type)));
  692+        q = mklnode(OREG, s, FPREG, p->n_type);
  693+        r = mklnode(OREG, s, FPREG, p->n_type);
  694+        ip = ipnode(mkbinode(ASSIGN, q, p, p->n_type));
  695+
  696+        if (xsaveip)
  697+                storesave = ip;
  698+        else
  699+                emit(ip);
698700         return r;
 699701 }
 700702 
     
 !
883885                 p->n_left->n_type = ty;
 884886 
 885887                 p->n_op = AND;
<>886 -                p->n_right = talloc();
 887 -                p->n_right->n_op = ICON;
 888 -                p->n_right->n_rall = NOPREF;
 889 -                p->n_right->n_type = ty;
 890 -                p->n_right->n_lval = 1;
 891 -                p->n_right->n_rval = 0;
 892 -                p->n_right->n_name = "";
 893 -                p->n_right->n_lval <<= s;
 894 -                p->n_right->n_lval--;
  888+                p->n_right = mklnode(ICON, (1 << s)-1, 0, ty);
895889 
 896890                 /* now, if a shift is needed, do it */
 897891 
 898892                 if( o != 0 ){
<>899 -                        shp = talloc();
 900 -                        shp->n_op = RS;
 901 -                        shp->n_rall = NOPREF;
 902 -                        shp->n_type = ty;
 903 -                        shp->n_left = p->n_left;
 904 -                        shp->n_right = talloc();
 905 -                        shp->n_right->n_op = ICON;
 906 -                        shp->n_right->n_rall = NOPREF;
 907 -                        shp->n_right->n_type = ty;
 908 -                        shp->n_right->n_rval = 0;
 909 -                        shp->n_right->n_lval = o;  /* amount to shift */
 910 -                        shp->n_right->n_name = "";
  893+                        shp = mkbinode(RS, p->n_left,
  894+                            mklnode(ICON, o, 0, ty), ty);
911895                         p->n_left = shp;
 912896                         /* whew! */
 913897                 }
     
 !
923907 deltemp(NODE *p)
 924908 {
 925909         struct tmpsave *w;
<>926 -        NODE *l, *r;
  910+        NODE *l;
927911 
 928912         if (p->n_op == TEMP) {
 929913                 /* Check if already existing */
     
 !
948932                 p->n_op = PLUS;
 949933                 l->n_op = REG;
 950934                 l->n_type = INCREF(l->n_type);
<>951 -                r = p->n_right = talloc();
 952 -                r->n_op = ICON;
 953 -                r->n_name = "";
 954 -                r->n_lval = l->n_lval;
 955 -                r->n_type = INT;
  935+                p->n_right = mklnode(ICON, l->n_lval, 0, INT);
956936         }
 957937 }
 958938 
     
 !
15971577          * node p must be converted to a call to fun.
 15981578          * arguments first.
 15991579          */
<>1600 -        q = talloc();
 1601 -        q->n_op = CM;;
 1602 -        q->n_left = l;
 1603 -        q->n_right = r;
  1580+        q = mkbinode(CM, l, r, 0);
16041581 
 16051582         if (p->n_op == STASG) {
 16061583                 /* Must push the size */
 16071584                 
<>1608 -                l = talloc();
 1609 -                l->n_op = ICON;
 1610 -                l->n_type = INT;
 1611 -                l->n_rval = 0;
 1612 -                l->n_lval = p->n_stsize;
 1613 -                l->n_name = "";
 1614 -                r = talloc();
 1615 -                r->n_op = CM;
 1616 -                r->n_left = q;
 1617 -                r->n_right = l;
  1585+                l = mklnode(ICON, p->n_stsize, 0, INT);
  1586+                r = mkbinode(CM, q, l, 0);
16181587                 q = r;
 16191588         }
 16201589         p->n_op = CALL;
 16211590         p->n_right = q;
 16221591 
 16231592         /* Make function name node */
<>1624 -        q = talloc();
 1625 -        q->n_op = ICON;
 1626 -        q->n_rval = q->n_lval = 0;
 1627 -        q->n_name = hop->fun;
 1628 -        p->n_left = q;
 1629 -
  1593+        p->n_left = mklnode(ICON, 0, 0, 0);
  1594+        p->n_left->n_name = hop->fun;
<_16301595         /* Done! */
 16311596 }
 16321597 
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-10-31 13:13 +0100