Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.87
 
1.88
 
MAIN:ragge:20030904074714
 
trees.c
_>14391439 }
 14401440 
 14411441 /*
<> 1442+ * Returns a TEMP node with temp number nr.
  1443+ * If nr == 0, return a node with a new number.
  1444+ */
  1445+NODE *
  1446+tempnode(int nr, TWORD type, union dimfun *df, struct suedef *sue)
  1447+{
  1448+        NODE *r;
  1449+        static int tvaloff;
  1450+
  1451+        r = block(TEMP, NIL, NIL, type, df, sue);
  1452+        r->n_lval = nr == 0 ? ++tvaloff : nr;
  1453+        return r;
  1454+}
  1455+
  1456+/*
14421457  * Do sizeof on p.
 14431458  * XXX - add runtime evaluation sizeof.
 14441459  */
     
 !
16751690         }
 16761691 }
 16771692 
<>1678 -int tvaloff;
 1679 -
16801693 /*
 16811694  * Massage the output trees to remove C-specific nodes:
 16821695  *      COMOPs are split into separate statements.
     
 !
16891702 {
 16901703         TWORD type;
 16911704         NODE *q, *r;
<>1692 -        int o, ty, lbl, lbl2, tval;
  1705+        int o, ty, lbl, lbl2, tval = 0;
16931706 
 16941707 again:
 16951708         o = p->n_op;
 16961709         ty = coptype(o);
 16971710         switch (o) {
 16981711         case QUEST:
 16991712 
<>1700 -                tval = tvaloff++;
17011713                 /*
 17021714                  * Create a branch node from ?:
 17031715                  * || and && must be taken special care of.
     
 !
17091721                 /* Only if type is not void */
 17101722                 q = p->n_right->n_left;
 17111723                 if (type != VOID) {
<>1712 -                        r = block(TEMP, NIL, NIL, q->n_type, q->n_df, q->n_sue);
 1713 -                        r->n_lval = tval;
  1724+                        r = tempnode(0, q->n_type, q->n_df, q->n_sue);
  1725+                        tval = r->n_lval;
17141726                         q = buildtree(ASSIGN, r, q);
 17151727                 }
 17161728                 rmcops(q);
     
 !
17201732 
 17211733                 q = p->n_right->n_right;
 17221734                 if (type != VOID) {
<>1723 -                        r = block(TEMP, NIL, NIL, q->n_type, q->n_df, q->n_sue);
 1724 -                        r->n_lval = tval;
  1735+                        r = tempnode(tval, q->n_type, q->n_df, q->n_sue);
17251736                         q = buildtree(ASSIGN, r, q);
 17261737                 }
 17271738                 rmcops(q);
     
 !
17501761 #ifdef SPECIAL_CCODES
 17511762 #error fix for private CCODES handling
 17521763 #else
<>1753 -                tval = tvaloff++;
17541764                 r = talloc();
 17551765                 *r = *p;
 17561766                 andorbr(r, -1, lbl = getlab());
<>1757 -                q = block(TEMP, NIL, NIL, p->n_type, p->n_df, p->n_sue);
 1758 -                q->n_lval = tval;
 1759 -                r = talloc();
 1760 -                *r = *q;
  1767+                q = tempnode(0, p->n_type, p->n_df, p->n_sue);
  1768+                tval = q->n_lval;
  1769+                r = tempnode(tval, p->n_type, p->n_df, p->n_sue);
17611770                 ecode(buildtree(ASSIGN, q, bcon(1)));
 17621771                 branch(lbl2 = getlab());
 17631772                 send_passt(IP_DEFLAB, lbl);
     
 !
18231832                 NODE *ll = l->n_left;
 18241833 
 18251834                 if (has_se(l)) {
<>1826 -                        q = block(TEMP, NIL, NIL,
 1827 -                            ll->n_type, ll->n_df, ll->n_sue);
 1828 -                        q->n_lval = tvaloff++;
 1829 -                        r = talloc();
 1830 -                        *r = *q;
  1835+                        q = tempnode(0, ll->n_type, ll->n_df, ll->n_sue);
  1836+                        r = tempnode(q->n_lval, ll->n_type, ll->n_df,ll->n_sue);
<_18311837                         l->n_left = q;
 18321838                         /* Now the left side of node p has no side effects. */
 18331839                         /* side effects on the right side must be obeyed */
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-08-22 23:39 +0200