Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.12
 
1.13
 
MAIN:ragge:20030531103446
 
reader.c
_>111111 {
 112112         int o, ty;
 113113 
<>114 -        o = p->in.op;
  114+        o = p->n_op;
115115         ty = optype( o );
 116116         if( ty == LTYPE ) return( 0 );
<>117 -        else if( ty == UTYPE ) return( delay1( p->in.left ) );
  117+        else if( ty == UTYPE ) return( delay1( p->n_left ) );
118118 
 119119         switch( o ){
 120120 
 121121         case QUEST:
 122122         case ANDAND:
 123123         case OROR:
 124124                 /* don't look on RHS */
<>125 -                return( delay1(p->in.left ) );
  125+                return( delay1(p->n_left ) );
126126 
 127127         case COMOP/* the meat of the routine */
<>128 -                delay( p->in.left );  /* completely evaluate the LHS */
  128+                delay( p->n_left );  /* completely evaluate the LHS */
129129                 /* rewrite the COMOP */
 130130                 { register NODE *q;
<>131 -                        q = p->in.right;
 132 -                        ncopy( p, p->in.right );
 133 -                        q->in.op = FREE;
  131+                        q = p->n_right;
  132+                        ncopy( p, p->n_right );
  133+                        q->n_op = FREE;
134134                         }
 135135                 return( 1 );
 136136         }
 137137 
<>138 -        return( delay1(p->in.left) || delay1(p->in.right ) );
  138+        return( delay1(p->n_left) || delay1(p->n_right ) );
139139 }
 140140 
 141141 void
     
 !
145145         /* look for delayable ++ and -- operators */
 146146 
 147147         int o, ty;
<>148 -        o = p->in.op;
  148+        o = p->n_op;
149149         ty = optype( o );
 150150 
 151151         switch( o ){
     
 !
177177                         if( deli < DELAYS ){
 178178                                 register NODE *q;
 179179                                 deltrees[deli++] = tcopy(p);
<>180 -                                q = p->in.left;
 181 -                                p->in.right->in.op = FREE/* zap constant */
  180+                                q = p->n_left;
  181+                                p->n_right->n_op = FREE/* zap constant */
182182                                 ncopy( p, q );
<>183 -                                q->in.op = FREE;
  183+                                q->n_op = FREE;
184184                                 return;
 185185                                 }
 186186                         }
 187187 
 188188                 }
 189189 
<>190 -        if( ty == BITYPE ) delay2( p->in.right );
 191 -        if( ty != LTYPE ) delay2( p->in.left );
  190+        if( ty == BITYPE ) delay2( p->n_right );
  191+        if( ty != LTYPE ) delay2( p->n_left );
192192 }
 193193 
 194194 /*
     
 !
291291         cookie = cook;
 292292         rcount();
 293293         canon(p);
<>294 -        rallo(p, p->in.rall);
  294+        rallo(p, p->n_rall);
295295         goto first;
 296296 
 297297 
     
 !
301301          */
 302302         again:
 303303 
<>304 -        if (p->in.op == FREE)
  304+        if (p->n_op == FREE)
305305                 return;         /* whole tree was done */
 306306         cookie = cook;
 307307         rcount();
 308308         canon(p);
<>309 -        rallo(p, p->in.rall);
  309+        rallo(p, p->n_rall);
310310         /*
 311311          * if any rewriting and canonicalization has put
 312312          * the tree (p) into a shape that cook is happy
     
 !
328328         }
 329329 # endif
 330330 
<>331 -        o = p->in.op;
  331+        o = p->n_op;
332332         ty = optype(o);
 333333 
 334334         /* first of all, for most ops, see if it is in the table */
 335335 
 336336         /* look for ops */
 337337 
<>338 -        switch (m = p->in.op) {
  338+        switch (m = p->n_op) {
339339 
 340340         default:
 341341                 /* look for op in table */
     
 !
373373          * fall through from above for hard ops
 374374          */
 375375 
<>376 -        p1 = p->in.left;
  376+        p1 = p->n_left;
377377         if (ty == BITYPE)
<>378 -                p2 = p->in.right;
  378+                p2 = p->n_right;
379379         else
 380380                 p2 = NIL;
 381381         
     
 !
391391         switch (m) {
 392392         default:
 393393                 nomat:
<>394 -                cerror( "no table entry for op %s", opst[p->in.op] );
  394+                cerror( "no table entry for op %s", opst[p->n_op] );
395395 
 396396         case COMOP:
 397397                 codgen( p1, FOREFF );
<>398 -                p2->in.rall = p->in.rall;
  398+                p2->n_rall = p->n_rall;
399399                 codgen( p2, cookie );
 400400                 ncopy( p, p2 );
<>401 -                p2->in.op = FREE;
  401+                p2->n_op = FREE;
402402                 goto cleanup;
 403403 
 404404         case FORCE:
 405405                 /* recurse, letting the work be done by rallo */
<>406 -                p = p->in.left;
  406+                p = p->n_left;
407407                 cook = INTAREG|INTBREG;
 408408                 goto again;
 409409 
 410410         case CBRANCH:
<>411 -                o = p2->tn.lval;
  411+                o = p2->n_lval;
412412                 cbranch( p1, -1, o );
<>413 -                p2->in.op = FREE;
 414 -                p->in.op = FREE;
  413+                p2->n_op = FREE;
  414+                p->n_op = FREE;
415415                 return;
 416416 
 417417         case QUEST:
 418418                 cbranch( p1, -1, m=getlab() );
<>419 -                p2->in.left->in.rall = p->in.rall;
 420 -                codgen( p2->in.left, INTAREG|INTBREG );
  419+                p2->n_left->n_rall = p->n_rall;
  420+                codgen( p2->n_left, INTAREG|INTBREG );
421421                 /* force right to compute result into same reg used by left */
<>422 -                p2->in.right->in.rall = p2->in.left->tn.rval|MUSTDO;
 423 -                reclaim( p2->in.left, RNULL, 0 );
  422+                p2->n_right->n_rall = p2->n_left->n_rval|MUSTDO;
  423+                reclaim( p2->n_left, RNULL, 0 );
424424                 cbgen( 0, m1 = getlab(), 'I' );
 425425                 deflab( m );
<>426 -                codgen( p2->in.right, INTAREG|INTBREG );
  426+                codgen( p2->n_right, INTAREG|INTBREG );
427427                 deflab( m1 );
<>428 -                p->in.op = REG/* set up node describing result */
 429 -                p->tn.lval = 0;
 430 -                p->tn.rval = p2->in.right->tn.rval;
 431 -                p->in.type = p2->in.right->in.type;
 432 -                tfree( p2->in.right );
 433 -                p2->in.op = FREE;
  428+                p->n_op = REG/* set up node describing result */
  429+                p->n_lval = 0;
  430+                p->n_rval = p2->n_right->n_rval;
  431+                p->n_type = p2->n_right->n_type;
  432+                tfree( p2->n_right );
  433+                p2->n_op = FREE;
434434                 goto cleanup;
 435435 
 436436         case ANDAND:
 437437         case OROR:
 438438         case NOT/* logical operators */
 439439                 /* if here, must be a logical operator for 0-1 value */
 440440                 cbranch( p, -1, m=getlab() );
<>441 -                p->in.op = CCODES;
 442 -                p->bn.label = m;
  441+                p->n_op = CCODES;
  442+                p->n_label = m;
443443                 order( p, INTAREG );
 444444                 goto cleanup;
 445445 
 446446         case FLD:       /* fields of funny type */
<>447 -                if ( p1->in.op == UNARY MUL ){
 448 -                        offstar( p1->in.left );
  447+                if ( p1->n_op == UNARY MUL ){
  448+                        offstar( p1->n_left );
449449                         goto again;
 450450                         }
 451451 
     
 !
464464                 return;
 465465 
 466466         case UNARY FORTCALL:
<>467 -                p->in.right = NIL;
  467+                p->n_right = NIL;
468468         case FORTCALL:
<>469 -                o = p->in.op = UNARY FORTCALL;
  469+                o = p->n_op = UNARY FORTCALL;
470470                 if( genfcall( p, cookie ) ) goto nomat;
 471471                 goto cleanup;
 472472 
 473473         case UNARY CALL:
<>474 -                p->in.right = NIL;
  474+                p->n_right = NIL;
475475         case CALL:
<>476 -                o = p->in.op = UNARY CALL;
  476+                o = p->n_op = UNARY CALL;
477477                 if( gencall( p, cookie ) ) goto nomat;
 478478                 goto cleanup;
 479479 
 480480         case UNARY STCALL:
<>481 -                p->in.right = NIL;
  481+                p->n_right = NIL;
482482         case STCALL:
<>483 -                o = p->in.op = UNARY STCALL;
  483+                o = p->n_op = UNARY STCALL;
484484                 if( genscall( p, cookie ) ) goto nomat;
 485485                 goto cleanup;
 486486 
     
 !
490490         case UNARY MUL:
 491491                 if( cook == FOREFF ){
 492492                         /* do nothing */
<>493 -                        order( p->in.left, FOREFF );
 494 -                        p->in.op = FREE;
  493+                        order( p->n_left, FOREFF );
  494+                        p->n_op = FREE;
495495                         return;
 496496                         }
 497497 #ifdef R2REGS
 498498                 /* try to coax a tree into a doubly indexed OREG */
<>499 -                p1 = p->in.left;
 500 -                if( p1->in.op == PLUS ) {
 501 -                        if( ISPTR(p1->in.left->in.type) &&
 502 -                            offset(p1->in.right, tlen(p)) >= 0 ) {
 503 -                                order( p1->in.left, INAREG|INTAREG );
  499+                p1 = p->n_left;
  500+                if( p1->n_op == PLUS ) {
  501+                        if( ISPTR(p1->n_left->n_type) &&
  502+                            offset(p1->n_right, tlen(p)) >= 0 ) {
  503+                                order( p1->n_left, INAREG|INTAREG );
504504                                 goto again;
 505505                                 }
<>506 -                        if( ISPTR(p1->in.right->in.type) &&
 507 -                            offset(p1->in.left, tlen(p)) >= 0 ) {
 508 -                                order( p1->in.right, INAREG|INTAREG );
  506+                        if( ISPTR(p1->n_right->n_type) &&
  507+                            offset(p1->n_left, tlen(p)) >= 0 ) {
  508+                                order( p1->n_right, INAREG|INTAREG );
509509                                 goto again;
 510510                                 }
 511511                         }
 512512 #endif
<>513 -                offstar( p->in.left );
  513+                offstar( p->n_left );
514514                 goto again;
 515515 
 516516         case INCR/* INCR and DECR */
     
 !
520520 
 521521                 if( cook & FOREFF ){  /* result not needed so inc or dec and be done with it */
 522522                         /* x++ => x += 1 */
<>523 -                        p->in.op = (p->in.op==INCR)?ASG PLUS:ASG MINUS;
  523+                        p->n_op = (p->n_op==INCR)?ASG PLUS:ASG MINUS;
524524                         goto again;
 525525                         }
 526526 
 527527                 p1 = tcopy(p);
<>528 -                reclaim( p->in.left, RNULL, 0 );
 529 -                p->in.left = p1;
 530 -                p1->in.op = (p->in.op==INCR)?ASG PLUS:ASG MINUS;
 531 -                p->in.op = (p->in.op==INCR)?MINUS:PLUS;
  528+                reclaim( p->n_left, RNULL, 0 );
  529+                p->n_left = p1;
  530+                p1->n_op = (p->n_op==INCR)?ASG PLUS:ASG MINUS;
  531+                p->n_op = (p->n_op==INCR)?MINUS:PLUS;
532532                 goto again;
 533533 
 534534         case STASG:
     
 !
541541                 /* there are assumed to be no side effects in LHS */
 542542 
 543543                 p2 = tcopy(p);
<>544 -                p->in.op = ASSIGN;
 545 -                reclaim( p->in.right, RNULL, 0 );
 546 -                p->in.right = p2;
  544+                p->n_op = ASSIGN;
  545+                reclaim( p->n_right, RNULL, 0 );
  546+                p->n_right = p2;
547547                 canon(p);
<>548 -                rallo( p, p->in.rall );
  548+                rallo( p, p->n_rall );
549549 
 550550 # ifndef BUG4
 551551                 if( odebug ) fwalk( p, e2print, 0 );
 552552 # endif
 553553 
<>554 -                order( p2->in.left, INTBREG|INTAREG );
  554+                order( p2->n_left, INTBREG|INTAREG );
555555                 order( p2, INTBREG|INTAREG );
 556556                 goto again;
 557557 
     
 !
576576                 case ER:
 577577                 case LS:
 578578                 case RS:
<>579 -                        p->in.op = ASG o;
  579+                        p->n_op = ASG o;
580580                         goto again;
 581581                         }
 582582                 goto nomat;
     
 !
592592                 return;
 593593                 }
 594594 
<>595 -        if( p->in.op==FREE ) return;
  595+        if( p->n_op==FREE ) return;
596596 
 597597         if( tshape( p, cook ) ) return;
 598598 
     
 !
615615 
 616616         int o, ty;
 617617 
<>618 -        o = p->in.op;
  618+        o = p->n_op;
619619         ty = optype(o);
 620620 
 621621         if( ty == LTYPE ) return;
     
 !
629629                 break;
 630630 
 631631         case UNARY MUL:
<>632 -                if (asgop(p->in.left->in.op))
 633 -                        stoasg(p->in.left, UNARY MUL);
  632+                if (asgop(p->n_left->n_op))
  633+                        stoasg(p->n_left, UNARY MUL);
634634                 break;
 635635 
 636636         case CALL:
 637637         case FORTCALL:
 638638         case STCALL:
<>639 -                store( p->in.left );
 640 -                stoarg( p->in.right, o );
  639+                store( p->n_left );
  640+                stoarg( p->n_right, o );
641641                 ++callflag;
 642642                 return;
 643643 
 644644         case COMOP:
<>645 -                markcall( p->in.right );
 646 -                if( p->in.right->in.su > fregs ) SETSTO( p, INTEMP );
 647 -                store( p->in.left );
  645+                markcall( p->n_right );
  646+                if( p->n_right->n_su > fregs ) SETSTO( p, INTEMP );
  647+                store( p->n_left );
648648                 return;
 649649 
 650650         case ANDAND:
 651651         case OROR:
 652652         case QUEST:
<>653 -                markcall( p->in.right );
 654 -                if( p->in.right->in.su > fregs ) SETSTO( p, INTEMP );
  653+                markcall( p->n_right );
  654+                if( p->n_right->n_su > fregs ) SETSTO( p, INTEMP );
655655         case CBRANCH:   /* to prevent complicated expressions on the LHS from being stored */
 656656         case NOT:
<>657 -                constore( p->in.left );
  657+                constore( p->n_left );
658658                 return;
 659659 
 660660                 }
 661661 
 662662         if (ty == UTYPE) {
<>663 -                store(p->in.left);
  663+                store(p->n_left);
664664                 return;
 665665         }
 666666 
<>667 -        if (asgop(p->in.right->in.op))
 668 -                stoasg(p->in.right, o);
  667+        if (asgop(p->n_right->n_op))
  668+                stoasg(p->n_right, o);
669669 
<>670 -        if( p->in.su>fregs ){ /* must store */
  670+        if( p->n_su>fregs ){ /* must store */
671671                 mkadrs( p );  /* set up stotree and stocook to subtree
 672672                                  that must be stored */
 673673                 }
 674674 
<>675 -        store( p->in.right );
 676 -        store( p->in.left );
  675+        store( p->n_right );
  676+        store( p->n_left );
677677         }
 678678 
 679679 /*
     
 !
684684 void
 685685 constore(NODE *p)
 686686 {
<>687 -        switch( p->in.op ) {
  687+        switch( p->n_op ) {
688688 
 689689         case ANDAND:
 690690         case OROR:
 691691         case QUEST:
<>692 -                markcall( p->in.right );
  692+                markcall( p->n_right );
693693         case NOT:
<>694 -                constore( p->in.left );
  694+                constore( p->n_left );
695695                 return;
 696696 
 697697                 }
     
 !
705705 {
 706706 
 707707         again:
<>708 -        switch( p->in.op ){
  708+        switch( p->n_op ){
709709 
 710710         case UNARY CALL:
 711711         case UNARY STCALL:
     
 !
718718 
 719719                 }
 720720 
<>721 -        switch( optype( p->in.op ) ){
  721+        switch( optype( p->n_op ) ){
722722 
 723723         case BITYPE:
<>724 -                markcall( p->in.right );
  724+                markcall( p->n_right );
725725         case UTYPE:
<>726 -                p = p->in.left;
  726+                p = p->n_left;
727727                 /* eliminate recursion (aren't I clever...) */
 728728                 goto again;
 729729         case LTYPE:
     
 !
736736 stoarg(NODE *p, int calltype)
 737737 {
 738738         /* arrange to store the args */
<>739 -        if( p->in.op == CM ){
 740 -                stoarg( p->in.left, calltype );
 741 -                p = p->in.right ;
  739+        if( p->n_op == CM ){
  740+                stoarg( p->n_left, calltype );
  741+                p = p->n_right ;
742742                 }
 743743         if( calltype == CALL ){
 744744                 STOARG(p);
     
 !
773773 
 774774         lab = -1;
 775775 
<>776 -        switch( o=p->in.op ){
  776+        switch( o=p->n_op ){
777777 
 778778         case ULE:
 779779         case ULT:
     
 !
786786         case GE:
 787787         case GT:
 788788                 if( true < 0 ){
<>789 -                        o = p->in.op = negrel[ o-EQ ];
  789+                        o = p->n_op = negrel[ o-EQ ];
790790                         true = false;
 791791                         false = -1;
 792792                         }
 793793 #ifndef NOOPT
<>794 -                if( p->in.right->in.op == ICON && p->in.right->tn.lval == 0 && p->in.right->in.name[0] == '\0' ){
  794+                if( p->n_right->n_op == ICON && p->n_right->n_lval == 0 && p->n_right->n_name[0] == '\0' ){
795795                         switch( o ){
 796796 
 797797                         case UGT:
 798798                         case ULE:
<>799 -                                o = p->in.op = (o==UGT)?NE:EQ;
  799+                                o = p->n_op = (o==UGT)?NE:EQ;
800800                         case EQ:
 801801                         case NE:
 802802                         case LE:
 803803                         case LT:
 804804                         case GE:
 805805                         case GT:
<>806 -                                if( logop(p->in.left->in.op) ){
  806+                                if( logop(p->n_left->n_op) ){
807807                                         /* strange situation: e.g., (a!=0) == 0 */
<>808 -                                        /* must prevent reference to p->in.left->lable, so get 0/1 */
  808+                                        /* must prevent reference to p->n_left->lable, so get 0/1 */
809809                                         /* we could optimize, but why bother */
<>810 -                                        codgen( p->in.left, INAREG|INBREG );
  810+                                        codgen( p->n_left, INAREG|INBREG );
811811                                         }
<>812 -                                codgen( p->in.left, FORCC );
  812+                                codgen( p->n_left, FORCC );
813813                                 cbgen( o, true, 'I' );
 814814                                 break;
 815815 
 816816                         case UGE:
<>817 -                                codgen(p->in.left, FORCC);
  817+                                codgen(p->n_left, FORCC);
818818                                 cbgen( 0, true, 'I' );  /* unconditional branch */
 819819                                 break;
 820820                         case ULT:
<>821 -                                codgen(p->in.left, FORCC);
  821+                                codgen(p->n_left, FORCC);
822822                                 }
 823823                         }
 824824                 else
 825825 #endif
 826826                         {
<>827 -                        p->bn.label = true;
  827+                        p->n_label = true;
828828                         codgen( p, FORCC );
 829829                         }
 830830                 if( false>=0 ) cbgen( 0, false, 'I' );
     
 !
833833 
 834834         case ANDAND:
 835835                 lab = false<0 ? getlab() : false ;
<>836 -                cbranch( p->in.left, -1, lab );
 837 -                cbranch( p->in.right, true, false );
  836+                cbranch( p->n_left, -1, lab );
  837+                cbranch( p->n_right, true, false );
838838                 if( false < 0 ) deflab( lab );
<>839 -                p->in.op = FREE;
  839+                p->n_op = FREE;
840840                 return;
 841841 
 842842         case OROR:
 843843                 lab = true<0 ? getlab() : true;
<>844 -                cbranch( p->in.left, lab, -1 );
 845 -                cbranch( p->in.right, true, false );
  844+                cbranch( p->n_left, lab, -1 );
  845+                cbranch( p->n_right, true, false );
846846                 if( true < 0 ) deflab( lab );
<>847 -                p->in.op = FREE;
  847+                p->n_op = FREE;
848848                 return;
 849849 
 850850         case NOT:
<>851 -                cbranch( p->in.left, false, true );
 852 -                p->in.op = FREE;
  851+                cbranch( p->n_left, false, true );
  852+                p->n_op = FREE;
853853                 break;
 854854 
 855855         case COMOP:
<>856 -                codgen( p->in.left, FOREFF );
 857 -                p->in.op = FREE;
 858 -                cbranch( p->in.right, true, false );
  856+                codgen( p->n_left, FOREFF );
  857+                p->n_op = FREE;
  858+                cbranch( p->n_right, true, false );
859859                 return;
 860860 
 861861         case QUEST:
 862862                 flab = false<0 ? getlab() : false;
 863863                 tlab = true<0 ? getlab() : true;
<>864 -                cbranch( p->in.left, -1, lab = getlab() );
 865 -                cbranch( p->in.right->in.left, tlab, flab );
  864+                cbranch( p->n_left, -1, lab = getlab() );
  865+                cbranch( p->n_right->n_left, tlab, flab );
866866                 deflab( lab );
<>867 -                cbranch( p->in.right->in.right, true, false );
  867+                cbranch( p->n_right->n_right, true, false );
868868                 if( true < 0 ) deflab( tlab);
 869869                 if( false < 0 ) deflab( flab );
<>870 -                p->in.right->in.op = FREE;
 871 -                p->in.op = FREE;
  870+                p->n_right->n_op = FREE;
  871+                p->n_op = FREE;
872872                 return;
 873873 
 874874         case ICON:
<>875 -                if( p->in.type != FLOAT && p->in.type != DOUBLE ){
  875+                if( p->n_type != FLOAT && p->n_type != DOUBLE ){
876876 
<>877 -                        if( p->tn.lval || p->in.name[0] ){
  877+                        if( p->n_lval || p->n_name[0] ){
878878                                 /* addresses of C objects are never 0 */
 879879                                 if( true>=0 ) cbgen( 0, true, 'I' );
 880880                                 }
 881881                         else if( false>=0 ) cbgen( 0, false, 'I' );
<>882 -                        p->in.op = FREE;
  882+                        p->n_op = FREE;
883883                         return;
 884884                         }
 885885                 /* fall through to default with other strange constants */
     
 !
917917         if( down-- ) printf( "    " );
 918918 
 919919 
<>920 -        printf( "%p) %s", p, opst[p->in.op] );
 921 -        switch( p->in.op ) { /* special cases */
  920+        printf( "%p) %s", p, opst[p->n_op] );
  921+        switch( p->n_op ) { /* special cases */
922922 
 923923         case REG:
<>924 -                printf( " %s", rnames[p->tn.rval] );
  924+                printf( " %s", rnames[p->n_rval] );
925925                 break;
 926926 
 927927         case ICON:
     
 !
935935         case UNARY STCALL:
 936936         case STARG:
 937937         case STASG:
<>938 -                printf( " size=%d", p->stn.stsize );
 939 -                printf( " align=%d", p->stn.stalign );
  938+                printf( " size=%d", p->n_stsize );
  939+                printf( " align=%d", p->n_stalign );
940940                 break;
 941941                 }
 942942 
 943943         printf( ", " );
<>944 -        tprint( p->in.type );
  944+        tprint( p->n_type );
945945         printf( ", " );
<>946 -        if( p->in.rall == NOPREF ) printf( "NOPREF" );
  946+        if( p->n_rall == NOPREF ) printf( "NOPREF" );
947947         else {
<>948 -                if( p->in.rall & MUSTDO ) printf( "MUSTDO " );
  948+                if( p->n_rall & MUSTDO ) printf( "MUSTDO " );
949949                 else printf( "PREF " );
<>950 -                printf( "%s", rnames[p->in.rall&~MUSTDO]);
  950+                printf( "%s", rnames[p->n_rall&~MUSTDO]);
951951                 }
<>952 -        printf( ", SU= %d\n", p->in.su );
  952+        printf( ", SU= %d\n", p->n_su );
953953         return 0;
 954954 }
 955955 # endif
     
 !
968968         NODE *shp;
 969969         int s, o, v, ty;
 970970 
<>971 -        *down1asgop( p->in.op );
  971+        *down1asgop( p->n_op );
972972         *down2 = 0;
 973973 
<>974 -        if( !down && p->in.op == FLD ){ /* rewrite the node */
  974+        if( !down && p->n_op == FLD ){ /* rewrite the node */
975975 
 976976                 if( !rewfld(p) ) return 0;
 977977 
<>978 -                ty = (szty(p->in.type) == 2)? LONG: INT;
 979 -                v = p->tn.rval;
  978+                ty = (szty(p->n_type) == 2)? LONG: INT;
  979+                v = p->n_rval;
980980                 s = UPKFSZ(v);
 981981 # ifdef RTOLBYTES
 982982                 o = UPKFOFF(v);  /* amount to shift */
 983983 # else
<>984 -                o = szty(p->in.type)*SZINT - s - UPKFOFF(v);  /* amount to shift */
  984+                o = szty(p->n_type)*SZINT - s - UPKFOFF(v);  /* amount to shift */
985985 #endif
 986986 
 987987                 /* make & mask part */
 988988 
<>989 -                p->in.left->in.type = ty;
  989+                p->n_left->n_type = ty;
990990 
<>991 -                p->in.op = AND;
 992 -                p->in.right = talloc();
 993 -                p->in.right->in.op = ICON;
 994 -                p->in.right->in.rall = NOPREF;
 995 -                p->in.right->in.type = ty;
 996 -                p->in.right->tn.lval = 1;
 997 -                p->in.right->tn.rval = 0;
 998 -                p->in.right->in.name = "";
 999 -                p->in.right->tn.lval <<= s;
 1000 -                p->in.right->tn.lval--;
  991+                p->n_op = AND;
  992+                p->n_right = talloc();
  993+                p->n_right->n_op = ICON;
  994+                p->n_right->n_rall = NOPREF;
  995+                p->n_right->n_type = ty;
  996+                p->n_right->n_lval = 1;
  997+                p->n_right->n_rval = 0;
  998+                p->n_right->n_name = "";
  999+                p->n_right->n_lval <<= s;
  1000+                p->n_right->n_lval--;
10011001 
 10021002                 /* now, if a shift is needed, do it */
 10031003 
 10041004                 if( o != 0 ){
 10051005                         shp = talloc();
<>1006 -                        shp->in.op = RS;
 1007 -                        shp->in.rall = NOPREF;
 1008 -                        shp->in.type = ty;
 1009 -                        shp->in.left = p->in.left;
 1010 -                        shp->in.right = talloc();
 1011 -                        shp->in.right->in.op = ICON;
 1012 -                        shp->in.right->in.rall = NOPREF;
 1013 -                        shp->in.right->in.type = ty;
 1014 -                        shp->in.right->tn.rval = 0;
 1015 -                        shp->in.right->tn.lval = o/* amount to shift */
 1016 -                        shp->in.right->in.name = "";
 1017 -                        p->in.left = shp;
  1006+                        shp->n_op = RS;
  1007+                        shp->n_rall = NOPREF;
  1008+                        shp->n_type = ty;
  1009+                        shp->n_left = p->n_left;
  1010+                        shp->n_right = talloc();
  1011+                        shp->n_right->n_op = ICON;
  1012+                        shp->n_right->n_rall = NOPREF;
  1013+                        shp->n_right->n_type = ty;
  1014+                        shp->n_right->n_rval = 0;
  1015+                        shp->n_right->n_lval = o/* amount to shift */
  1016+                        shp->n_right->n_name = "";
  1017+                        p->n_left = shp;
10181018                         /* whew! */
 10191019                 }
 10201020         }
     
 !
10331033         NODE *ql, *qr;
 10341034         CONSZ temp;
 10351035 
<>1036 -        if (p->in.op == UNARY MUL) {
 1037 -                q = p->in.left;
 1038 -                if (q->in.op == REG) {
 1039 -                        temp = q->tn.lval;
 1040 -                        r = q->tn.rval;
 1041 -                        cp = q->in.name;
  1036+        if (p->n_op == UNARY MUL) {
  1037+                q = p->n_left;
  1038+                if (q->n_op == REG) {
  1039+                        temp = q->n_lval;
  1040+                        r = q->n_rval;
  1041+                        cp = q->n_name;
10421042                         goto ormake;
 10431043                 }
 10441044 
<>1045 -                if (q->in.op != PLUS && q->in.op != MINUS)
  1045+                if (q->n_op != PLUS && q->n_op != MINUS)
10461046                         return;
<>1047 -                ql = q->in.left;
 1048 -                qr = q->in.right;
  1047+                ql = q->n_left;
  1048+                qr = q->n_right;
10491049 
 10501050 #ifdef R2REGS
 10511051 
 10521052                 /* look for doubly indexed expressions */
 10531053 
<>1054 -                if( q->in.op == PLUS) {
  1054+                if( q->n_op == PLUS) {
10551055                         int i;
 10561056                         if( (r=base(ql))>=0 && (i=offset(qr, tlen(p)))>=0) {
 10571057                                 makeor2(p, ql, r, i);
     
 !
10651065 
 10661066 #endif
 10671067 
<>1068 -                if( (q->in.op==PLUS || q->in.op==MINUS) && qr->in.op == ICON &&
 1069 -                                ql->in.op==REG && szty(qr->in.type)==1) {
 1070 -                        temp = qr->tn.lval;
 1071 -                        if( q->in.op == MINUS ) temp = -temp;
 1072 -                        r = ql->tn.rval;
 1073 -                        temp += ql->tn.lval;
 1074 -                        cp = qr->in.name;
 1075 -                        if( *cp && ( q->in.op == MINUS || *ql->in.name ) ) return;
 1076 -                        if( !*cp ) cp = ql->in.name;
  1068+                if( (q->n_op==PLUS || q->n_op==MINUS) && qr->n_op == ICON &&
  1069+                                ql->n_op==REG && szty(qr->n_type)==1) {
  1070+                        temp = qr->n_lval;
  1071+                        if( q->n_op == MINUS ) temp = -temp;
  1072+                        r = ql->n_rval;
  1073+                        temp += ql->n_lval;
  1074+                        cp = qr->n_name;
  1075+                        if( *cp && ( q->n_op == MINUS || *ql->n_name ) ) return;
  1076+                        if( !*cp ) cp = ql->n_name;
10771077 
 10781078                         ormake:
<>1079 -                        if( notoff( p->in.type, r, temp, cp ) ) return;
 1080 -                        p->in.op = OREG;
 1081 -                        p->tn.rval = r;
 1082 -                        p->tn.lval = temp;
 1083 -                        p->in.name = cp;
  1079+                        if( notoff( p->n_type, r, temp, cp ) ) return;
  1080+                        p->n_op = OREG;
  1081+                        p->n_rval = r;
  1082+                        p->n_lval = temp;
  1083+                        p->n_name = cp;
<_10841084                         tfree(q);
 10851085                         return;
 10861086                 }
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 05:27 +0100