Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.273
 
1.274
 
MAIN:ragge:20110407185015
 
trees.c
_>188188                         break;
 189189                 }
 190190         } else if (o == NOT && l->n_op == FCON) {
<>191 -                l = clocal(block(SCONV, l, NIL, INT, 0, MKAP(INT)));
  191+                l = clocal(block(SCONV, l, NIL, INT, 0, 0));
192192         } else if( o == UMINUS && l->n_op == FCON ){
 193193                         l->n_dcon = FLOAT_NEG(l->n_dcon);
 194194                         return(l);
     
 !
290290                         t = (l->n_type > r->n_type ? l->n_type : r->n_type);
 291291                         l->n_op = FCON;
 292292                         l->n_type = t;
<>293 -                        l->n_ap = MKAP(t);
294293                         nfree(r);
 295294                         return(l);
 296295                 case EQ:
     
 !
330329 #endif
 331330         /* its real; we must make a new node */
 332331 
<>333 -        p = block(o, l, r, INT, 0, MKAP(INT));
  332+        p = block(o, l, r, INT, 0, 0);
334333 
 335334         actions = opact(p);
 336335 
     
 !
468467                 case LS:
 469468                 case RS: /* must make type size at least int... */
 470469                         if (p->n_type == CHAR || p->n_type == SHORT) {
<>471 -                                p->n_left = makety(l, INT, 0, 0, MKAP(INT));
  470+                                p->n_left = makety(l, INT, 0, 0, 0);
472471                         } else if (p->n_type == UCHAR || p->n_type == USHORT) {
<>473 -                                p->n_left = makety(l, UNSIGNED, 0, 0,
 474 -                                    MKAP(UNSIGNED));
  472+                                p->n_left = makety(l, UNSIGNED, 0, 0, 0);
475473                         }
 476474                         l = p->n_left;
 477475                         p->n_type = l->n_type;
     
 !
483481                 case LSEQ:
 484482                 case RSEQ: /* ...but not for assigned types */
 485483                         if(tsize(r->n_type, r->n_df, r->n_ap) > SZINT)
<>486 -                                p->n_right = makety(r, INT, 0, 0, MKAP(INT));
  484+                                p->n_right = makety(r, INT, 0, 0, 0);
487485                         break;
 488486 
 489487                 case RETURN:
     
 !
646644         /* Get a label name */
 647645         if (sp->sflags == SLBLNAME) {
 648646                 p->n_type = VOID;
<>649 -                p->n_ap = MKAP(VOID);
650647         }
 651648 #endif
 652649         if (sp->stype == UNDEF) {
 653650                 uerror("%s undefined", sp->sname);
 654651                 /* make p look reasonable */
 655652                 p->n_type = INT;
<>656 -                p->n_ap = MKAP(INT);
657653                 p->n_df = NULL;
 658654                 defid(p, SNULL);
 659655         }
     
 !
676672 {
 677673         NODE *q;
 678674 
<>679 -        q = block(NAME, NIL, NIL, t, 0, MKAP(BTYPE(t)));
  675+        q = block(NAME, NIL, NIL, t, 0, 0);
680676         q->n_qual = u;
 681677         q = buildtree(CAST, q, p);
 682678         p = q->n_right;
     
 !
758754                         td = INT;
 759755                 u = ISUNSIGNED(td);
 760756                 if (tl != td)
<>761 -                        p = makety(p, td, 0, 0, MKAP(td));
  757+                        p = makety(p, td, 0, 0, 0);
762758                 if (tr != td)
<>763 -                        q = makety(q, td, 0, 0, MKAP(td));
  759+                        q = makety(q, td, 0, 0, 0);
764760         } else
 765761                 u = ISUNSIGNED(tl) || ISUNSIGNED(tr);
 766762         if( u && (o==LE||o==LT||o==GE||o==GT)) o += (UGE-GE);
     
 !
896892 valcast(CONSZ v, TWORD t)
 897893 {
 898894         CONSZ r;
<> 895+        int sz;
899896 
 900897         if (t < CHAR || t > ULONGLONG)
 901898                 return v; /* cannot cast */
     
 !
907904 #define NOTM(x) (~M(x))
 908905 #define SBIT(x) (1ULL << ((x)-1))
 909906 
<>910 -        r = v & M(btattr[t].atypsz);
 911 -        if (!ISUNSIGNED(t) && (SBIT(btattr[t].atypsz) & r))
 912 -                r = r | NOTM(btattr[t].atypsz);
  907+        sz = tsize(t, NULL, NULL);
  908+        r = v & M(sz);
  909+        if (!ISUNSIGNED(t) && (SBIT(sz) & r))
  910+                r = r | NOTM(sz);
913911         return r;
 914912 }
 915913 
     
 !
10731071 #if 0
 10741072         if (dsc & FIELD) {  /* make fields look like ints */
 10751073                 off = (off/ALINT)*ALINT;
<>1076 -                ap = MKAP(INT);
10771074         }
 10781075 #endif
 10791076         if (off != 0) {
     
 !
11351132 {
 11361133         NODE *p;
 11371134 
<>1138 -        p = block(ICON, NIL, NIL, type, 0, MKAP(type));
  1135+        p = block(ICON, NIL, NIL, type, 0, 0);
11391136         p->n_lval = val;
 11401137         p->n_sp = sp;
 11411138         return clocal(p);
     
 !
11451142 bpsize(NODE *p)
 11461143 {
 11471144         int isdyn(struct symtab *sp);
<>1148 -        struct attr *ap;
11491145         struct symtab s;
 11501146         NODE *q, *r;
 11511147         TWORD t;
<> 1148+        int sz;
11521149 
 11531150         s.stype = DECREF(p->n_type);
 11541151         s.sdf = p->n_df;
     
 !
11591156                                 return buildtree(MUL, q, bcon(SZPOINT(t)));
 11601157                         if (ISARY(t)) {
 11611158                                 if (s.sdf->ddim < 0)
<>1162 -                                        r = tempnode(-s.sdf->ddim,
 1163 -                                             INT, 0, MKAP(INT));
  1159+                                        r = tempnode(-s.sdf->ddim, INT, 0, 0);
11641160                                 else
 11651161                                         r = bcon(s.sdf->ddim/SZCHAR);
 11661162                                 q = buildtree(MUL, q, r);
 11671163                                 s.sdf++;
 11681164                         }
 11691165                 }
<>1170 -                ap = attr_find(p->n_ap, ATTR_BASETYP);
 1171 -                p = buildtree(MUL, q, bcon(ap->atypsz/SZCHAR));
  1166+                sz = tsize(p->n_type, p->n_df, p->n_ap);
  1167+                p = buildtree(MUL, q, bcon(sz/SZCHAR));
11721168         } else
 11731169                 p = (offcon(psize(p), p->n_type, p->n_df, p->n_ap));
 11741170         return p;
     
 !
12211217         df = s->n_df;
 12221218         while (ISARY(ty)) {
 12231219                 rv = buildtree(MUL, rv, df->ddim >= 0 ? bcon(df->ddim) :
<>1224 -                    tempnode(-df->ddim, INT, 0, MKAP(INT)));
  1220+                    tempnode(-df->ddim, INT, 0, 0));
12251221                 df++;
 12261222                 ty = DECREF(ty);
 12271223         }
<>1228 -        rv = clocal(block(PMCONV, rv, r, INT, 0, MKAP(INT)));
  1224+        rv = clocal(block(PMCONV, rv, r, INT, 0, 0));
12291225         rv = optim(rv);
 12301226 
<>1231 -        r = block(PMCONV, q, rv, INT, 0, MKAP(INT));
  1227+        r = block(PMCONV, q, rv, INT, 0, 0);
12321228         r = clocal(r);
 12331229         /*
 12341230          * Indexing is only allowed with integer arguments, so insert
 12351231          * SCONV here if arg is not an integer.
 12361232          * XXX - complain?
 12371233          */
 12381234         if (r->n_type != INTPTR)
<>1239 -                r = clocal(block(SCONV, r, NIL, INTPTR, 0, MKAP(INTPTR)));
  1235+                r = clocal(block(SCONV, r, NIL, INTPTR, 0, 0));
12401236         if (f == CVTL)
 12411237                 p->n_left = r;
 12421238         else
     
 !
12821278 
 12831279         case MINUS:
 12841280                 p->n_type = INTPTR;
<>1285 -                p->n_ap = MKAP(INTPTR);
  1281+                p->n_ap = NULL;
12861282                 returnclocal( block( PVCONV,
<>1287 -                        p, bpsize(p->n_left), INT, 0, MKAP(INT))));
  1283+                        p, bpsize(p->n_left), INT, 0, 0)));
12881284                 }
 12891285 
 12901286         cerror( "illegal oconvert: %d", p->n_op );
     
 !
14671463 
 14681464         if (t != tl || (ru && !lu)) {
 14691465                 if (o != CAST && r->n_op != ICON &&
<>1470 -                    tsize(tl, 0, MKAP(tl)) > tsize(tu, 0, MKAP(tu)))
  1466+                    tsize(tl, 0, 0) > tsize(tu, 0, 0))
14711467                         warner(Wtruncate, tnames[tu], tnames[tl]);
<>1472 -                p->n_left = makety( p->n_left, tu, 0, 0, MKAP(tu));
  1468+                p->n_left = makety( p->n_left, tu, 0, 0, 0);
14731469         }
 14741470 
 14751471         if (t != tr || o==CAST || (lu && !ru)) {
 14761472                 if (o != CAST && r->n_op != ICON &&
<>1477 -                    tsize(tr, 0, MKAP(tr)) > tsize(tu, 0, MKAP(tu)))
  1473+                    tsize(tr, 0, 0) > tsize(tu, 0, 0))
14781474                         warner(Wtruncate, tnames[tu], tnames[tr]);
<>1479 -                p->n_right = makety(p->n_right, tu, 0, 0, MKAP(tu));
  1475+                p->n_right = makety(p->n_right, tu, 0, 0, 0);
14801476         }
 14811477 
 14821478         if( casgop(o) ){
     
 !
14871483         else if( !clogop(o) ){
 14881484                 p->n_type = tu;
 14891485                 p->n_df = NULL;
<>1490 -                p->n_ap = MKAP(t);
  1486+                p->n_ap = NULL;
14911487                 }
 14921488 
 14931489 #ifdef PCC_DEBUG
     
 !
15121508 static NODE *
 15131509 fzero(TWORD t)
 15141510 {
<>1515 -        NODE *p = block(FCON, NIL, NIL, t, 0, MKAP(t));
  1511+        NODE *p = block(FCON, NIL, NIL, t, 0, 0);
15161512 
 15171513         p->n_dcon = FLOAT_CAST(0, INT);
 15181514         return p;
     
 !
15671563                                 p->n_type = t + (IMAG-COMPLEX);
 15681564                                 p->n_qual = q;
 15691565                                 p->n_df = d;
<>1570 -                                p->n_ap = MKAP(p->n_type);
 1571 -                                return block(CM, r, p, t, 0, MKAP(t));
  1566+                                p->n_ap = NULL;
  1567+                                return block(CM, r, p, t, 0, 0);
15721568                         } else if (ISFTY(p->n_type)) {
 15731569                                 /* convert to correct subtype */
 15741570                                 r = fzero(t + (IMAG-COMPLEX));
 15751571                                 p->n_type = t - (COMPLEX-DOUBLE);
 15761572                                 p->n_qual = q;
 15771573                                 p->n_df = d;
<>1578 -                                p->n_ap = MKAP(p->n_type);
 1579 -                                return block(CM, p, r, t, 0, MKAP(t));
  1574+                                p->n_ap = NULL;
  1575+                                return block(CM, p, r, t, 0, 0);
15801576                         } else if (ISCTY(p->n_type))
 15811577                                 cerror("complex constant2");
 15821578                 }
     
 !
15951591                         p->n_dcon = FLOAT_CAST(p->n_lval, p->n_type);
 15961592                         p->n_type = t;
 15971593                         p->n_qual = q;
<>1598 -                        p->n_ap = MKAP(t);
  1594+                        p->n_ap = NULL;
15991595                         return (clocal(p));
 16001596                 } else if (ISCTY(t) || ISITY(t))
 16011597                         cerror("complex constant3");
     
 !
19151911                         if (arrstkp)
 19161912                                 q = arrstk[astkp++];
 19171913                         else
<>1918 -                                q = tempnode(-df->ddim, INT, 0, MKAP(INT));
  1914+                                q = tempnode(-df->ddim, INT, 0, 0);
19191915                 } else
 19201916                         q = bcon(df->ddim);
 19211917                 rv = buildtree(MUL, rv, q);
     
 !
25952591                         NODE *r;
 25962592                         int l, l2;
 25972593 
<>2598 -                        r = tempnode(0, BOOL_TYPE, NULL, MKAP(BOOL_TYPE));
  2594+                        r = tempnode(0, BOOL_TYPE, NULL, 0);
25992595                         cbranch(buildtree(EQ, p->n_left, bcon(0)),
 26002596                             bcon(l = getlab()));
 26012597                         *p = *r;
     
 !
28662862         if ((n->n_type >= CHAR && n->n_type < INT) || n->n_type == BOOL) {
 28672863                 if ((n->n_type == UCHAR && MAX_UCHAR > MAX_INT) ||
 28682864                     (n->n_type == USHORT && MAX_USHORT > MAX_INT))
<>2869 -                        return makety(n, UNSIGNED, 0, 0, MKAP(UNSIGNED));
 2870 -                return makety(n, INT, 0, 0, MKAP(INT));
  2865+                        return makety(n, UNSIGNED, 0, 0, 0);
  2866+                return makety(n, INT, 0, 0, 0);
<_28712867         }
 28722868         return n;
 28732869 }
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-31 18:56 +0100