Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.195
 
1.196
 
MAIN:ragge:20060715073419
 
reader.c
_>9898 void compile2(struct interpass *ip);
 9999 void compile3(struct interpass *ip);
 100100 void compile4(struct interpass *ip);
<>101 -struct interpass delayq;
102101 
 103102 static void gencode(NODE *p, int cookie);
 104103 
     
 !
112111         int tempno;
 113112 } *tmpsave;
 114113 
<>115 -#define DELAYS 20
 116 -NODE *deltrees[DELAYS];
 117 -int deli;
 118 -
119114 #ifdef PCC_DEBUG
 120115 static void
 121116 cktree(NODE *p)
     
 !
130125 #endif
 131126 
 132127 /*
<>133 - * See if post-decrement and post-increment operators can be delayed
 134 - * past this statement.  This is only possible if it do not end up
 135 - * after a function call.
 136 - * There may be instructions that will do post-in/decrement, therefore
 137 - * call special routines to check if we can do this.
 138 - */
 139 -void
 140 -delay(NODE *p)
 141 -{
 142 -        struct interpass *ip;
 143 -        NODE *q;
 144 -
 145 -        int ty = optype(p->n_op);
 146 -
 147 -        switch (p->n_op) {
 148 -        case UCALL:
 149 -        case STCALL:
 150 -        case USTCALL:
 151 -        case FORTCALL:
 152 -        case UFORTCALL:
 153 -        case CBRANCH:
 154 -                /* for the moment, don't delay past a conditional context, or
 155 -                 * inside of a call */
 156 -                return;
 157 -
 158 -        case UMUL:
 159 -                /* if *p++, do not rewrite */
 160 -                if( autoincr( p ) ) return;
 161 -                break;
 162 -
 163 -        case INCR:
 164 -        case DECR:
 165 -                break;
 166 -                if( deltest( p ) ){
 167 -                        ip = ipnode(tcopy(p));
 168 -                        DLIST_INSERT_BEFORE(&delayq, ip, qelem);
 169 -                        q = p->n_left;
 170 -                        nfree(p->n_right); /* zap constant */
 171 -                        *p = *q;
 172 -                        nfree(q);
 173 -                        return;
 174 -                }
 175 -
 176 -        }
 177 -
 178 -        if (ty == BITYPE)
 179 -                delay(p->n_right);
 180 -        if (ty != LTYPE)
 181 -                delay(p->n_left);
 182 -}
 183 -
 184 -/*
185128  * Check if a node has side effects.
 186129  */
 187130 static int
     
 !
194137         case FORCE:
 195138         case INIT:
 196139         case ASSIGN:
<>197 -        case INCR:
 198 -        case DECR:
199140         case CALL:
 200141         case FORTCALL:
 201142         case CBRANCH:
     
 !
287228                         continue;
 288229                 if (xtemps == 0)
 289230                         walkf(ip->ip_node, deltemp);
<>290 -                DLIST_INIT(&delayq, qelem);
 291 -                delay(ip->ip_node);
 292 -                while (DLIST_NEXT(&delayq, qelem) != &delayq) {
 293 -                        struct interpass *ip2;
 294 -                        ip2 = DLIST_NEXT(&delayq, qelem);
 295 -                        DLIST_REMOVE(ip2, qelem);
 296 -                        DLIST_INSERT_AFTER(ip, ip2, qelem);
 297 -                        ip = ip2;
 298 -                }
 299 -
300231         }
 301232         DLIST_FOREACH(ip, &ipole, qelem) {
 302233                 if (ip->type != IP_NODE)
     
 !
468399                 rv = findops(p, cookie);
 469400                 break;
 470401 
<>471 -        case INCR:
 472 -        case DECR:
 473 -                rv = findasg(p, cookie);
 474 -                if (rv != FFAIL)
 475 -                        break;
 476 -
 477 -                /*
 478 -                 * Rewrite x++ to (x = x + 1) -1;
 479 -                 */
 480 -                p1 = p->n_left;
 481 -                p->n_op = o == INCR ? MINUS : PLUS;
 482 -                /* Assign node */
 483 -                p2 = talloc();
 484 -                p2->n_type = p->n_type;
 485 -                p2->n_name = "";
 486 -                p2->n_op = ASSIGN;
 487 -                p->n_left = p2;
 488 -                p->n_left->n_left = p1;
 489 -                /* incr/decr node */
 490 -                p2 = talloc();
 491 -                p2->n_type = p->n_type;
 492 -                p2->n_name = "";
 493 -                p2->n_op = o == INCR ? PLUS : MINUS;
 494 -                p->n_left->n_right = p2;
 495 -                /* const one node */
 496 -                p->n_left->n_right->n_right = tcopy(p->n_right);
 497 -                /* input tree */
 498 -                p1 = tcopy(p1);
 499 -                /* idstrip(p1); */
 500 -                p->n_left->n_right->n_left = p1;
 501 -                canon(p); /* if fields involved */
 502 -                goto again;
 503 -
<_504402         case ASSIGN:
 505403         case STASG:
 506404                 rv = findasg(p, cookie);
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-09-01 20:38 +0200