Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.241
 
1.242
 
MAIN:ragge:20081116115241
 
reader.c
_>8888 void deltemp(NODE *p);
 8989 static void cvtemps(struct interpass *ipole, int op, int off);
 9090 NODE *store(NODE *);
<>91 -static void fixxasm(struct interpass *ip);
  91+static void fixxasm(struct p2env *);
9292 
 9393 static void gencode(NODE *p, int cookie);
 9494 static void genxasm(NODE *p);
     
 !
100100         int tempno;
 101101 } *tmpsave;
 102102 
<>103 -static struct interpass ipole;
 104 -struct interpass_prolog *ipp, *epp;
  103+struct p2env p2env;
105104 
 106105 #ifdef PCC_DEBUG
 107106 static int *lbldef, *lbluse;
     
 !
118117                  if (!logop(p->n_left->n_op))
 119118                         cerror("%p) not logop branch", p);
 120119                 i = p->n_right->n_lval;
<>121 -                if (i < ipp->ip_lblnum || i >= epp->ip_lblnum)
  120+                if (i < p2env.ipp->ip_lblnum || i >= p2env.epp->ip_lblnum)
122121                         cerror("%p) label %d outside boundaries %d-%d",
<>123 -                            p, i, ipp->ip_lblnum, epp->ip_lblnum);
 124 -                lbluse[i-ipp->ip_lblnum] = 1;
  122+                            p, i, p2env.ipp->ip_lblnum, p2env.epp->ip_lblnum);
  123+                lbluse[i-p2env.ipp->ip_lblnum] = 1;
125124         }
 126125         if ((dope[p->n_op] & ASGOPFLG) && p->n_op != RETURN)
 127126                 cerror("%p) asgop %d slipped through", p, p->n_op);
 128127         if (p->n_op == TEMP &&
<>129 -            (regno(p) < ipp->ip_tmpnum || regno(p) >= epp->ip_tmpnum))
  128+            (regno(p) < p2env.ipp->ip_tmpnum || regno(p) >= p2env.epp->ip_tmpnum))
130129                 cerror("%p) temporary %d outside boundaries %d-%d",
<>131 -                    p, regno(p), ipp->ip_tmpnum, epp->ip_tmpnum);
  130+                    p, regno(p), p2env.ipp->ip_tmpnum, p2env.epp->ip_tmpnum);
132131         if (p->n_op == GOTO) {
 133132                 i = p->n_left->n_lval;
<>134 -                if (i < ipp->ip_lblnum || i >= epp->ip_lblnum)
  133+                if (i < p2env.ipp->ip_lblnum || i >= p2env.epp->ip_lblnum)
135134                         cerror("%p) label %d outside boundaries %d-%d",
<>136 -                            p, i, ipp->ip_lblnum, epp->ip_lblnum);
 137 -                lbluse[i-ipp->ip_lblnum] = 1;
  135+                            p, i, p2env.ipp->ip_lblnum, p2env.epp->ip_lblnum);
  136+                lbluse[i-p2env.ipp->ip_lblnum] = 1;
138137         }
 139138 }
 140139 
     
 !
149148 #ifdef notyet
 150149         TMPMARK();
 151150 #endif
<>152 -        lbldef = tmpcalloc(sizeof(int) * (epp->ip_lblnum - ipp->ip_lblnum));
 153 -        lbluse = tmpcalloc(sizeof(int) * (epp->ip_lblnum - ipp->ip_lblnum));
  151+        lbldef = tmpcalloc(sizeof(int) * (p2env.epp->ip_lblnum - p2env.ipp->ip_lblnum));
  152+        lbluse = tmpcalloc(sizeof(int) * (p2env.epp->ip_lblnum - p2env.ipp->ip_lblnum));
154153 
<>155 -        DLIST_FOREACH(ip, &ipole, qelem) {
  154+        DLIST_FOREACH(ip, &p2env.ipole, qelem) {
156155                 if (ip->type == IP_DEFLAB) {
 157156                         i = ip->ip_lbl;
<>158 -                        if (i < ipp->ip_lblnum || i >= epp->ip_lblnum)
  157+                        if (i < p2env.ipp->ip_lblnum || i >= p2env.epp->ip_lblnum)
159158                                 cerror("label %d outside boundaries %d-%d",
<>160 -                                    i, ipp->ip_lblnum, epp->ip_lblnum);
 161 -                        lbldef[i-ipp->ip_lblnum] = 1;
  159+                                    i, p2env.ipp->ip_lblnum, p2env.epp->ip_lblnum);
  160+                        lbldef[i-p2env.ipp->ip_lblnum] = 1;
162161                 }
 163162                 if (ip->type == IP_NODE)
 164163                         walkf(ip->ip_node, cktree);
 165164         }
<>166 -        for (i = 0; i < (epp->ip_lblnum - ipp->ip_lblnum); i++)
  165+        for (i = 0; i < (p2env.epp->ip_lblnum - p2env.ipp->ip_lblnum); i++)
167166                 if (lbluse[i] != 0 && lbldef[i] == 0)
 168167                         cerror("internal label %d not defined",
<>169 -                            i + ipp->ip_lblnum);
  168+                            i + p2env.ipp->ip_lblnum);
170169 
 171170 #ifdef notyet
 172171         TMPFREE();
     
 !
246245 pass2_compile(struct interpass *ip)
 247246 {
 248247         if (ip->type == IP_PROLOG) {
<> 248+                memset(&p2env, 0, sizeof(struct p2env));
249249                 tmpsave = NULL;
<>250 -                ipp = (struct interpass_prolog *)ip;
 251 -                DLIST_INIT(&ipole, qelem);
  250+                p2env.ipp = (struct interpass_prolog *)ip;
  251+                DLIST_INIT(&p2env.ipole, qelem);
252252         }
<>253 -        DLIST_INSERT_BEFORE(&ipole, ip, qelem);
  253+        DLIST_INSERT_BEFORE(&p2env.ipole, ip, qelem);
254254         if (ip->type != IP_EPILOG)
 255255                 return;
 256256 
 257257 #ifdef PCC_DEBUG
 258258         if (e2debug) {
 259259                 printf("Entering pass2\n");
<>260 -                printip(&ipole);
  260+                printip(&p2env.ipole);
261261         }
 262262 #endif
 263263 
<>264 -        epp = (struct interpass_prolog *)DLIST_PREV(&ipole, qelem);
 265 -        p2maxautooff = p2autooff = epp->ipp_autos;
  264+        p2env.epp = (struct interpass_prolog *)DLIST_PREV(&p2env.ipole, qelem);
  265+        p2maxautooff = p2autooff = p2env.epp->ipp_autos;
266266 
 267267 #ifdef PCC_DEBUG
 268268         sanitychecks();
 269269 #endif
<>270 -        myreader(&ipole); /* local massage of input */
  270+        myreader(&p2env.ipole); /* local massage of input */
271271 
<>272 -        DLIST_FOREACH(ip, &ipole, qelem) {
  272+        DLIST_FOREACH(ip, &p2env.ipole, qelem) {
273273                 if (ip->type != IP_NODE)
 274274                         continue;
 275275                 if (xtemps == 0)
 276276                         walkf(ip->ip_node, deltemp);
 277277         }
 278278         DLIST_INIT(&prepole, qelem);
<>279 -        DLIST_FOREACH(ip, &ipole, qelem) {
  279+        DLIST_FOREACH(ip, &p2env.ipole, qelem) {
280280                 if (ip->type != IP_NODE)
 281281                         continue;
 282282                 canon(ip->ip_node);
     
 !
291291                 }
 292292         }
 293293 
<>294 -        fixxasm(&ipole); /* setup for extended asm */
  294+        fixxasm(&p2env); /* setup for extended asm */
295295 
<>296 -        optimize(&ipole);
 297 -        ngenregs(&ipole);
  296+        optimize(&p2env);
  297+        ngenregs(&p2env);
298298 
<>299 -        DLIST_FOREACH(ip, &ipole, qelem)
  299+        DLIST_FOREACH(ip, &p2env.ipole, qelem)
300300                 emit(ip);
 301301 }
 302302 
     
 !
13391339         /* Delete number by adding move-to/from-temp.  Later on */
 13401340         /* the temps may be rewritten to other LTYPEs */
 13411341         t = p->n_left->n_type;
<>1342 -        r = mklnode(TEMP, 0, epp->ip_tmpnum++, t);
  1342+        r = mklnode(TEMP, 0, p2env.epp->ip_tmpnum++, t);
13431343 
 13441344         /* pre node */
 13451345         ip2 = ipnode(mkbinode(ASSIGN, tcopy(r), p->n_left, t));
     
 !
13911391                         break;
 13921392                 q = p->n_left;
 13931393                 r = (cw & XASMINOUT ? tcopy(q) : q);
<>1394 -                p->n_left = mklnode(TEMP, 0, epp->ip_tmpnum++, t);
  1394+                p->n_left = mklnode(TEMP, 0, p2env.epp->ip_tmpnum++, t);
13951395                 if ((cw & XASMASG) == 0) {
 13961396                         ip2 = ipnode(mkbinode(ASSIGN, tcopy(p->n_left), r, t));
 13971397                         DLIST_INSERT_BEFORE(ip, ip2, qelem);
     
 !
14191419                 } else if (q->n_op == UMUL &&
 14201420                     (q->n_left->n_op != TEMP && q->n_left->n_op != REG)) {
 14211421                         t = q->n_left->n_type;
<>1422 -                        ooff = epp->ip_tmpnum++;
  1422+                        ooff = p2env.epp->ip_tmpnum++;
14231423                         ip2 = ipnode(mkbinode(ASSIGN,
 14241424                             mklnode(TEMP, 0, ooff, t), q->n_left, t));
 14251425                         q->n_left = mklnode(TEMP, 0, ooff, t);
     
 !
14471447 
 14481448 /* Extended assembler hacks */
 14491449 static void
<>1450 -fixxasm(struct interpass *pole)
  1450+fixxasm(struct p2env *p2e)
14511451 {
<> 1452+        struct interpass *pole = &p2e->ipole;
<_14521453         struct interpass *ip;
 14531454         NODE *p;
 14541455 
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-22 23:37 +0200