Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.54
 
1.55
 
MAIN:ragge:20030713123729
 
trees.c
_>792792         case OREG:
 793793         case UNARY MUL:
 794794                 if( ISARY(p->n_type) || ISFTN(p->n_type) ) return(1);
<> 795+        case TEMP:
795796         case REG:
 796797                 return(0);
 797798 
     
 !
14421443         }
 14431444 }
 14441445 
<> 1446+int tvaloff;
14451447 
<> 1448+/*
  1449+ * Turn COMOP and QUEST/COLON into normal statements.
  1450+ */
  1451+static void
  1452+rmcops(NODE *p)
  1453+{
  1454+#if 0
  1455+        NODE *q, *r;
  1456+        int o, ty, lbl, lbl2, tval;
  1457+#else
  1458+        NODE *q;
  1459+        int o, ty;
  1460+#endif
  1461+
  1462+again:
  1463+        o = p->n_op;
  1464+        ty = optype(o);
  1465+        switch (ty) {
  1466+        case LTYPE:
  1467+                break;
  1468+        case UTYPE:
  1469+                rmcops(p->n_left);
  1470+                break;
  1471+        case BITYPE:
  1472+                switch (o) {
  1473+                case QUEST:
  1474+#if 0
  1475+                        /*
  1476+                         * Create a CBRANCH node from ?:
  1477+                         */
  1478+                        tval = tvaloff++;
  1479+                        rmcops(p->n_left);
  1480+                        q = block(CBRANCH, p->n_left, bcon(lbl = getlab()),
  1481+                            p->n_type, NULL, p->n_sue);
  1482+                        ecode(q); /* Done with branch! */
  1483+
  1484+                        /* Make ASSIGN node */
  1485+                        q = p->n_right->n_left;
  1486+                        r = block(TEMP, NIL, NIL, q->n_type, q->n_df, q->n_sue);
  1487+                        r->n_lval = tval;
  1488+                        q = buildtree(ASSIGN, r, q);
  1489+                        rmcops(q);
  1490+                        ecode(q); /* Done with assign */
  1491+
  1492+                        branch(lbl2 = getlab());
  1493+                        send_passt(IP_DEFLAB, lbl);
  1494+
  1495+                        q = p->n_right->n_right;
  1496+                        r = block(TEMP, NIL, NIL, q->n_type, q->n_df, q->n_sue);
  1497+                        r->n_lval = tval;
  1498+                        q = buildtree(ASSIGN, r, q);
  1499+                        rmcops(q);
  1500+                        ecode(q); /* Done with assign */
  1501+
  1502+                        send_passt(IP_DEFLAB, lbl2);
  1503+
  1504+                        nfree(p->n_right);
  1505+                        p->n_op = TEMP;
  1506+                        p->n_lval = tval;
  1507+#endif
  1508+                        break;
  1509+
  1510+                case ANDAND:
  1511+                case OROR:
  1512+                        rmcops(p->n_left);
  1513+                        break;
  1514+                case COMOP:
  1515+                        rmcops(p->n_left);
  1516+                        ecode(p->n_left);
  1517+                        /* Now when left tree is dealt with, rm COMOP */
  1518+                        q = p->n_right;
  1519+                        *p = *p->n_right;
  1520+                        nfree(q);
  1521+                        goto again;
  1522+
  1523+                default:
  1524+                        rmcops(p->n_left);
  1525+                        rmcops(p->n_right);
  1526+                }
  1527+        }
  1528+}
  1529+
  1530+
14461531 int edebug = 0;
 14471532 void
 14481533 ecomp(NODE *p)
     
 !
14591544         p = optim(p);
 14601545         walkf(p, prtdcon);
 14611546         send_passt(IP_LOCCTR, PROG);
<> 1547+        rmcops(p);
<_14621548         ecode(p);
 14631549 }
 14641550 
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 05:01 +0100