Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.49
 
1.50
 
MAIN:ragge:20030707141035
 
trees.c
_>55 # include <stdarg.h>
 66 # include <string.h>
 77 
<>8 -int adebug = 0/* XXX 4.4 */
 9 -
108 void chkpun(NODE *p);
 119 int opact(NODE *p);
 1210 int moditype(TWORD);
     
 !
2826 # define OTHER 04000
 2927 # define NCVTR 010000
 3028 
<>31 -#ifdef PCC_DEBUG
 32 -static void
 33 -printact(NODE *t, int acts)     /* XXX 4.4  hela printact */
 34 -{
 35 -        static struct actions {
 36 -                int     a_bit;
 37 -                char    *a_name;
 38 -        } actions[] = {
 39 -                { PUN,          "PUN" },
 40 -                { CVTL,         "CVTL" },
 41 -                { CVTR,         "CVTR" },
 42 -                { TYPL,         "TYPL" },
 43 -                { TYPR,         "TYPR" },
 44 -                { TYMATCH,      "TYMATCH" },
 45 -                { PTMATCH,      "PTMATCH" },
 46 -                { LVAL,         "LVAL" },
 47 -                { CVTO,         "CVTO" },
 48 -                { NCVT,         "NCVT" },
 49 -                { OTHER,        "OTHER" },
 50 -                { NCVTR,        "NCVTR" },
 51 -                { 0 }
 52 -        };
 53 -        register struct actions *p;
 54 -        char *sep = " ";
 55 -
 56 -        printf("actions");
 57 -        for (p = actions; p->a_name; p++)
 58 -                if (p->a_bit & acts) {
 59 -                        printf("%s%s", sep, p->a_name);
 60 -                        sep = "|";
 61 -                }
 62 -        if (!bdebug) {
 63 -                printf(" for:\n");
 64 -                fwalk(t, eprint, 0);
 65 -        } else
 66 -                putchar('\n');
 67 -}
 68 -#endif
 69 -
7029 /* node conventions:
 7130 
 7231         NAME:   rval>0 is stab index for external
     
 !
214173         p = block(o, l, r, INT, 0, MKSUE(INT));
 215174 
 216175         actions = opact(p);
<>217 -#ifdef PCC_DEBUG
 218 -        if (adebug)     /* XXX 4.4 */
 219 -                printact(p, actions);
 220 -#endif
221176 
 222177         if( actions&LVAL ){ /* check left descendent */
 223178                 if( notlval(p->n_left) ) {
     
 !
369324                                 nfree(l);
 370325                                 break;
 371326 
<>372 -# ifdef ADDROREG        /* XXX 4.4  addroreg */
 373 -                        case OREG:
 374 -                                /* OREG was built in clocal()
 375 -                                 * for an auto or formal parameter
 376 -                                 * now its address is being taken
 377 -                                 * local code must unwind it
 378 -                                 * back to PLUS/MINUS REG ICON
 379 -                                 * according to local conventions
 380 -                                 */
 381 -                                nfree(p);
 382 -                                p = addroreg( l );
 383 -                                break;
 384 -
 385 -# endif
386327                         default:
 387328                                 uerror("unacceptable operand of &: %d", l->n_op );
 388329                                 break;
 389330                                 }
 390331                         break;
 391332 
 392333                 case LS:
<>393 -                case RS:        /* XXX 4.4 satsen */
 394 -                        if( l->n_type == CHAR || l->n_type == SHORT )
 395 -                                p->n_type = INT;
 396 -                        else if( l->n_type == UCHAR || l->n_type == USHORT )
 397 -                                p->n_type = UNSIGNED;
 398 -                        else
 399 -                                p->n_type = l->n_type;
  334+                case RS:
400335                 case ASG LS:
 401336                 case ASG RS:
<>402 -                        if( r->n_type != INT )
  337+                        if(tsize(p->n_right->n_type, p->n_right->n_df, p->n_right->n_sue) > SZINT)
403338                                 p->n_right = r = makety(r, INT, 0, MKSUE(INT));
 404339                         break;
 405340 
     
 !
483418          * XXX - anything on the right side must be possible to cast.
 484419          * XXX - remove void types further on.
 485420          */
<>486 -        if (p->n_op == CAST && p->n_type == UNDEF &&
  421+        if (p->n_op == CAST && p->n_type == VOID &&
487422             p->n_right->n_op == ICON)
<>488 -                p->n_right->n_type = UNDEF;
  423+                p->n_right->n_type = VOID;
489424 
 490425         if( actions & CVTO ) p = oconvert(p);
 491426         p = clocal(p);
     
 !
1011946 
 1012947         t1 = p->n_left->n_type;
 1013948         t2 = p->n_right->n_type;
<>1014 -        if( (t1==UNDEF || t2==UNDEF) && o!=CAST )       /* XXX 4.4 */
 1015 -                uerror("void type illegal in expression");
1016949 
 1017950         u = 0;
 1018951         if( ISUNSIGNED(t1) ){
     
 !
1027960         if( ( t1 == CHAR || t1 == SHORT ) && o!= RETURN ) t1 = INT;
 1028961         if( t2 == CHAR || t2 == SHORT ) t2 = INT;
 1029962 
<>1030 -#ifdef SPRECC   /* XXX 4.4 */
 1031 -        if( t1 == DOUBLE || t2 == DOUBLE )
 1032 -                t = DOUBLE;
 1033 -        else if( t1 == FLOAT || t2 == FLOAT )
 1034 -                t = FLOAT;
 1035 -#else
1036963         if (t1 == DOUBLE || t1 == FLOAT || t2 == DOUBLE || t2 == FLOAT)
 1037964                 t = DOUBLE;
<>1038 -#endif
1039965         else if (t1==LONG || t2==LONG)
 1040966                 t = LONG;
 1041967         else if (t1==LONGLONG || t2 == LONGLONG)
 1042968                 t = LONGLONG;
 1043969         else
 1044970                 t = INT;
 1045971 
<>1046 -        if( o == ASSIGN || o == CAST || o == RETURN ) { /* XXX 4.4 */
  972+        if( asgop(o) ){
1047973                 tu = p->n_left->n_type;
 1048974                 t = t1;
 1049975         } else {
     
 !
1055981            are those involving FLOAT/DOUBLE, and those
 1056982            from LONG to INT and ULONG to UNSIGNED */
 1057983 
<>1058 -        if( (t != t1 || (u && !ISUNSIGNED(p->n_left->n_type))) && ! asgop(o) )  /* XXX 4.4 */
 1059 -                p->n_left = makety( p->n_left, tu, 0, MKSUE(tu));       /* XXX 4.4 */
1060984 
<>1061 -        if( t != t2 || (u && !ISUNSIGNED(p->n_right->n_type)) || o==CAST) {     /* XXX 4.4 */
 1062 -                if ( tu == ENUMTY ) {/* always asgop */ /* XXX 4.4 */
 1063 -                        p->n_right = makety( p->n_right, INT, 0, MKSUE(INT));   /* XXX 4.4 */
 1064 -                        p->n_right->n_type = tu;        /* XXX 4.4 */
 1065 -                        p->n_right->n_df = p->n_left->n_df;     /* XXX 4.4 */
 1066 -                        p->n_right->n_sue = p->n_left->n_sue;   /* XXX 4.4 */
 1067 -                        }       /* XXX 4.4 */
 1068 -                else    /* XXX 4.4 */
 1069 -                        p->n_right = makety( p->n_right, tu, 0, MKSUE(tu));     /* XXX 4.4 */
 1070 -        }
  985+        if( t != t1 ) p->n_left = makety( p->n_left, tu, 0, MKSUE(tu));
1071986 
<> 987+        if( t != t2 || o==CAST) p->n_right = makety( p->n_right, tu, 0, MKSUE(tu));
  988+
1072989         if( asgop(o) ){
 1073990                 p->n_type = p->n_left->n_type;
 1074991                 p->n_df = p->n_left->n_df;
     
 !
1080997                 p->n_sue = MKSUE(t);
 1081998                 }
 1082999 
<>1083 -# ifndef BUG1
  1000+#ifdef PCC_DEBUG
10841001         if (tdebug)
 10851002                 printf("tymatch(%p): %o %s %o => %o\n",p,t1,opst[o],t2,tu );
<>1086 -# endif
  1003+#endif
10871004 
 10881005         return(p);
 10891006         }
     
 !
11911108 # define MENU 040       /* enumeration variable or member */
 11921109 
 11931110 int
<>1194 -opact(NODE *p)  /* XXX 4.4 hela opact mixtrad med */
  1111+opact(NODE *p)
<_11951112 {
 11961113         int mt12, mt1, mt2, o;
 11971114 
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-18 21:16 +0100