Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.89
 
1.90
 
MAIN:ragge:20040509182657
 
reader.c
_>275275 pass2_compile(struct interpass *ip)
 276276 {
 277277         if (ip->type == IP_NODE) {
<> 278+#ifdef PCC_DEBUG
  279+                if (e2debug) {
  280+                        printf("pass2 called on:\n");
  281+                        fwalk(ip->ip_node, e2print, 0);
  282+                }
  283+#endif
278284                 ip->ip_node = deluseless(ip->ip_node);
 279285                 if (ip->ip_node == NULL)
 280286                         return;
     
 !
986992 }
 987993 #endif
 988994 
<>989 -/*
 990 - * change left TEMPs into OREGs
 991 - */
 992 -void
 993 -deltemp(NODE *p)
  995+static int
  996+findtemp(NODE *p)
994997 {
 995998         struct templst *w = templst;
 996999 
<>997 -        if (p->n_op != TEMP)
 998 -                return;
 999 -        /*
 1000 -         * the size of a TEMP is in multiples of the reg size.
 1001 -         */
 1002 -        p->n_op = OREG;
 1003 -        p->n_rval = FPREG;
10041000         while (w != NULL) {
 10051001                 if (w->tempnr == p->n_lval)
 10061002                         break;
     
 !
10091005         if (w == NULL) {
 10101006                 w = tmpalloc(sizeof(struct templst));
 10111007                 w->tempnr = p->n_lval;
<>1012 -                w->tempoff = BITOOR(freetemp(szty(p->n_type)));
  1008+                w->tempoff = freetemp(szty(p->n_type));
10131009                 w->next = templst;
 10141010                 templst = w;
 10151011         }
<>1016 -        p->n_lval = w->tempoff;
  1012+        return w->tempoff;
  1013+}
  1014+
  1015+/*
  1016+ * change left TEMPs into OREGs
  1017+ */
  1018+void
  1019+deltemp(NODE *p)
  1020+{
  1021+        NODE *l, *r;
  1022+
  1023+        if (p->n_op == ADDROF) {
  1024+                /* TEMPs are already converted to OREGs */
  1025+                if ((l = p->n_left)->n_op != OREG)
  1026+                        comperr("bad U&");
  1027+                p->n_op = PLUS;
  1028+                l->n_op = REG;
  1029+                l->n_type = INCREF(l->n_type);
  1030+                r = p->n_right = talloc();
  1031+                r->n_op = ICON;
  1032+                r->n_name = "";
  1033+                r->n_lval = l->n_lval;
  1034+                r->n_type = INT;
  1035+                return;
  1036+        }
  1037+        if (p->n_op != TEMP)
  1038+                return;
  1039+        /*
  1040+         * the size of a TEMP is in multiples of the reg size.
  1041+         */
  1042+        p->n_op = OREG;
  1043+        p->n_rval = FPREG;
  1044+        p->n_lval = findtemp(p);
10171045         p->n_name = "";
 10181046 }
 10191047 
     
 !
17431771  * allocate k integers worth of temp space
 17441772  * we also make the convention that, if the number of words is
 17451773  * more than 1, it must be aligned for storing doubles...
<> 1774+ * Returns bits offset from base register.
  1775+ * XXX - redo this.
<_17461776  */
 17471777 int
 17481778 freetemp(int k)
FishEye: Open Source License registered to PCC.
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-12-23 00:27 +0100