Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.82
 
1.83
 
MAIN:ragge:20030823122546
 
trees.c
_>17871787        }
 17881788 }
 17891789 
<> 1790+/*
  1791+ * Return 1 if an assignment is found.
  1792+ */
  1793+static int
  1794+has_se(NODE *p)
  1795+{
  1796+        if (cdope(p->n_op) & ASGFLG)
  1797+                return 1;
  1798+        if (coptype(p->n_op) == LTYPE)
  1799+                return 0;
  1800+        if (has_se(p->n_left))
  1801+                return 1;
  1802+        if (coptype(p->n_op) == BITYPE)
  1803+                return has_se(p->n_right);
  1804+        return 0;
  1805+}
17901806 
<> 1807+/*
  1808+ * Find and convert asgop's to separate statements.
  1809+ * Be careful about side effects.
  1810+ * assign tells whether ASSIGN should be considered giving
  1811+ * side effects or not.
  1812+ */
  1813+static void
  1814+delasgop(NODE *p)
  1815+{
  1816+        NODE *q, *r;
  1817+
  1818+        if ((cdope(p->n_op)&ASGOPFLG) && p->n_op != RETURN && p->n_op != CAST) {
  1819+                NODE *l = p->n_left;
  1820+                NODE *ll = l->n_left;
  1821+
  1822+                if (has_se(l)) {
  1823+                        q = block(TEMP, NIL, NIL,
  1824+                            ll->n_type, ll->n_df, ll->n_sue);
  1825+                        q->n_lval = tvaloff++;
  1826+                        r = talloc();
  1827+                        *r = *q;
  1828+                        l->n_left = q;
  1829+                        /* Now the left side of node p has no side effects. */
  1830+                        /* side effects on the right side must be obeyed */
  1831+                        delasgop(p);
  1832+                        
  1833+                        r = buildtree(ASSIGN, r, ll);
  1834+                        delasgop(r);
  1835+                        ecode(r);
  1836+                } else {
  1837+                        p->n_right = buildtree(NOASG p->n_op, ccopy(l),
  1838+                            p->n_right);
  1839+                        p->n_op = ASSIGN;
  1840+                        delasgop(p->n_right);
  1841+                }
  1842+        } else {
  1843+                if (coptype(p->n_op) == LTYPE)
  1844+                        return;
  1845+                delasgop(p->n_left);
  1846+                if (coptype(p->n_op) == BITYPE)
  1847+                        delasgop(p->n_right);
  1848+        }
  1849+}
  1850+
17911851 int edebug = 0;
 17921852 void
 17931853 ecomp(NODE *p)
     
 !
18031863         }
 18041864         p = optim(p);
 18051865         rmcops(p);
<> 1866+        delasgop(p);
<_18061867         send_passt(IP_LOCCTR, PROG);
 18071868         if (p->n_op == ICON && p->n_type == VOID)
 18081869                 tfree(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-10-01 18:23 +0200