Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.208
 
1.209
 
MAIN:ragge:20081020202501
 
trees.c
_>7070 # include "pass2.h"
 7171 
 7272 # include <stdarg.h>
<>73 -#ifdef mach_pdp11
 74 -#include <setjmp.h>
 75 -#endif
7673 
 7774 static void chkpun(NODE *p);
 7875 static int opact(NODE *p);
     
 !
16341631 }
 16351632 # endif
 16361633 
<> 1634+#ifdef mach_pdp11
16371635 /*
<> 1636+ * Emit everything that should be emitted on the left side
  1637+ * of a comma operator, and remove the operator.
  1638+ * Do not traverse through QUEST, ANDAND and OROR.
  1639+ * Enable this for all targets when stable enough.
  1640+ */
  1641+static void
  1642+comops(NODE *p)
  1643+{
  1644+        int o;
  1645+        NODE *q;
  1646+
  1647+        while (p->n_op == COMOP) {
  1648+                ecomp(p->n_left); /* will recurse if more COMOPs */
  1649+                q = p->n_right;
  1650+                *p = *q;
  1651+                nfree(q);
  1652+        }
  1653+        o = coptype(p->n_op);
  1654+        if (p->n_op == QUEST || p->n_op == ANDAND || p->n_op == OROR)
  1655+                o = UTYPE;
  1656+        if (o != LTYPE)
  1657+                comops(p->n_left);
  1658+        if (o == BITYPE)
  1659+                comops(p->n_right);
  1660+}
  1661+#endif
  1662+
  1663+/*
16381664  * Walk up through the tree from the leaves,
 16391665  * removing constant operators.
 16401666  */
     
 !
17821808         case ANDAND:
 17831809                 lab = false<0 ? getlab() : false ;
 17841810                 andorbr(p->n_left, -1, lab);
<> 1811+#ifdef mach_pdp11
  1812+                comops(p->n_right);
  1813+#endif
17851814                 andorbr(p->n_right, true, false);
 17861815                 if (false < 0)
 17871816                         plabel( lab);
     
 !
17911820         case OROR:
 17921821                 lab = true<0 ? getlab() : true;
 17931822                 andorbr(p->n_left, lab, -1);
<> 1823+#ifdef mach_pdp11
  1824+                comops(p->n_right);
  1825+#endif
17941826                 andorbr(p->n_right, true, false);
 17951827                 if (true < 0)
 17961828                         plabel( lab);
     
 !
18151847         }
 18161848 }
 18171849 
<>1818 -#ifdef mach_pdp11
 1819 -jmp_buf comopbuf;
 1820 -#endif
 1821 -
18221850 /*
 18231851  * Massage the output trees to remove C-specific nodes:
 18241852  *      COMOPs are split into separate statements.
     
 !
18331861         NODE *q, *r;
 18341862         int o, ty, lbl, lbl2, tval = 0;
 18351863 
<>1836 -#ifndef mach_pdp11
18371864 again:
<>1838 -#endif
18391865         o = p->n_op;
 18401866         ty = coptype(o);
 18411867         switch (o) {
     
 !
18511877                 /* Make ASSIGN node */
 18521878                 /* Only if type is not void */
 18531879                 q = p->n_right->n_left;
<> 1880+#ifdef mach_pdp11
  1881+                comops(q);
  1882+#endif
18541883                 if (type != VOID) {
 18551884                         r = tempnode(0, q->n_type, q->n_df, q->n_sue);
 18561885                         tval = regno(r);
     
 !
18621891                 plabel( lbl);
 18631892 
 18641893                 q = p->n_right->n_right;
<> 1894+#ifdef mach_pdp11
  1895+                comops(q);
  1896+#endif
18651897                 if (type != VOID) {
 18661898                         r = tempnode(tval, q->n_type, q->n_df, q->n_sue);
 18671899                         q = buildtree(ASSIGN, r, q);
     
 !
19181950                 p->n_op = ICON; p->n_type = VOID;
 19191951                 break;
 19201952         case COMOP:
<> 1953+#ifdef mach_pdp11
  1954+                cerror("COMOP error");
  1955+#else
19211956                 rmcops(p->n_left);
 19221957                 ecode(p->n_left);
 19231958                 /* Now when left tree is dealt with, rm COMOP */
 19241959                 q = p->n_right;
 19251960                 *p = *p->n_right;
 19261961                 nfree(q);
<>1927 -#ifdef mach_pdp11
 1928 -                longjmp(comopbuf, 1);
 1929 -#else
 1930 -                goto again;
19311962 #endif
<> 1963+                goto again;
19321964 
 19331965         default:
 19341966                 if (ty == LTYPE)
     
 !
20352067         }
 20362068         p = optim(p);
 20372069 #ifdef mach_pdp11
<>2038 -        setjmp(comopbuf);
  2070+        comops(p);
<_20392071 #endif
 20402072         rmcops(p);
 20412073         p = delasgop(p);
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-23 20:11 +0200