Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.22
 
1.23
 
MAIN:ragge:20030713123729
 
reader.c
_>88 
 99 int nrecur;
 1010 int lflag;
<>11 -#ifdef FORT
 12 -int Oflag = 0;
 13 -#endif
1411 extern int Wflag;
 1512 int x2debug;
 1613 int udebug = 0;
     
 !
2623 OFFSZ baseoff = 0;
 2724 OFFSZ maxtemp = 0;
 2825 
<> 26+static struct templst {
  27+        struct templst *next;
  28+        int tempnr;
  29+        int tempoff;
  30+} *templst;
  31+
2932 int e2print(NODE *p, int down, int *a, int *b);
<> 33+static void splitline(NODE *);
3034 
 3135 static void
 3236 p2compile(NODE *p)
     
 !
4852         MYREADER(p);  /* do your own laundering of the input */
 4953 # endif
 5054         nrecur = 0;
<>51 -        delay( p );  /* do the code generation */
  55+        if (Oflag)
  56+                splitline(p);
  57+        else
  58+                delay( p );  /* do the code generation */
5259         reclaim( p, RNULL, 0 );
 5360         allchk();
 5461         /* can't do tcheck here; some stuff (e.g., attributes) may be around from first pass */
     
 !
112119 epilogue(int regs, int autos, int retlab)
 113120 {
 114121         SETOFF(maxoff, ALSTACK);
<> 122+        templst = NULL;
115123         eoftn(regs, autos, retlab);
 116124 }
 117125 
 118126 NODE *deltrees[DELAYS];
 119127 int deli;
 120128 
<> 129+void xtrcomop(NODE *p);
  130+NODE *saveq[100];
  131+int nsaveq = 0;
  132+
  133+void
  134+splitline(NODE *p)
  135+{
  136+        int i;
  137+
  138+        nsaveq = 0;
  139+
  140+#if 0
  141+printf("splitlineq:\n");
  142+        for (i = 0; i < nsaveq; i++)
  143+                fwalk(saveq[i], e2print, 0);
  144+        fwalk(p, e2print, 0);
  145+#endif
  146+
  147+        for (i = 0; i < nsaveq; i++)
  148+                codgen(saveq[i], FOREFF);
  149+        codgen(p, FOREFF);
  150+}
  151+
121152 /*
 122153  * look in all legal places for COMOP's and ++ and -- ops to delay
 123154  * note; don't delay ++ and -- within calls or things like
     
 !
966997                 printf( " %s", rnames[p->n_rval] );
 967998                 break;
 968999 
<> 1000+        case TEMP:
  1001+                printf(" %d", (int)p->n_lval);
  1002+                break;
  1003+
9691004         case ICON:
 9701005         case NAME:
 9711006         case OREG:
     
 !
10641099 }
 10651100 #endif
 10661101 
<> 1102+/*
  1103+ * change left TEMPs into OREGs
  1104+ * look for situations where we can turn * into OREG
  1105+ */
10671106 void
 10681107 oreg2(NODE *p)
 10691108 {
<>1070 -        /* look for situations where we can turn * into OREG */
10711109 
 10721110         NODE *q;
 10731111         int r;
 10741112         char *cp;
 10751113         NODE *ql, *qr;
 10761114         CONSZ temp;
 10771115 
<> 1116+        /*
  1117+         * the size of a TEMP is on multiples of the reg size.
  1118+         */
  1119+        if (p->n_op == TEMP) {
  1120+                extern int autooff;
  1121+                struct templst *w = templst;
  1122+                p->n_op = OREG;
  1123+                p->n_rval = FPREG;
  1124+                while (w != NULL) {
  1125+                        if (w->tempnr == p->n_lval)
  1126+                                break;
  1127+                        w = w->next;
  1128+                }
  1129+                if (w == NULL) {
  1130+                        w = tmpalloc(sizeof(struct templst));
  1131+                        w->tempnr = p->n_lval;
  1132+                        w->tempoff = BITOOR(freetemp(szty(p->n_type)));
  1133+                        autooff = tmpoff;
  1134+                        w->next = templst;
  1135+                        templst = w;
  1136+                }
  1137+                p->n_lval = w->tempoff;
  1138+                p->n_name = "";
  1139+                return;
  1140+        }
  1141+
<_10781142         if (p->n_op == UNARY MUL) {
 10791143                 q = p->n_left;
 10801144                 if (q->n_op == REG) {
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-30 17:43 +0100