Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.251
 
1.252
 
MAIN:ragge:20100811140844
 
trees.c
_>175175                         break;
 176176                 }
 177177         } else if (o == NOT && l->n_op == FCON) {
<>178 -                l = clocal(block(SCONV, l, NIL, INT, 0, MKSUE(INT)));
  178+                l = clocal(block(SCONV, l, NIL, INT, 0, MKAP(INT)));
179179         } else if( o == UMINUS && l->n_op == FCON ){
 180180                         l->n_dcon = FLOAT_NEG(l->n_dcon);
 181181                         return(l);
     
 !
271271                         }
 272272                         l->n_op = FCON;
 273273                         l->n_type = DOUBLE;
<>274 -                        l->n_sue = MKSUE(DOUBLE);
  274+                        l->n_ap = MKAP(DOUBLE);
275275                         nfree(r);
 276276                         return(l);
 277277                 case EQ:
     
 !
309309 runtime:
 310310         /* its real; we must make a new node */
 311311 
<>312 -        p = block(o, l, r, INT, 0, MKSUE(INT));
  312+        p = block(o, l, r, INT, 0, MKAP(INT));
313313 
 314314         actions = opact(p);
 315315 
     
 !
352352                 p->n_type = q->n_type;
 353353                 p->n_qual = q->n_qual;
 354354                 p->n_df = q->n_df;
<>355 -                p->n_sue = q->n_sue;
  355+                p->n_ap = q->n_ap;
356356                 }
 357357 
 358358         if( actions & CVTL ) p = convert( p, CVTL );
     
 !
361361         if( actions & PTMATCH ) p = ptmatch(p);
 362362 
 363363         if( actions & OTHER ){
<>364 -                struct suedef *sue2;
 365 -                struct suedef *sue;
  364+                struct symtab *sp1;
366365 
 367366                 l = p->n_left;
 368367                 r = p->n_right;
     
 !
382381                                 break;
 383382                         }
 384383 
<>385 -                        /* find type sue */
 386 -                        GETSUE(sue, l->n_sue);
 387 -                        if ((sp = sue->suem) == NULL) {
  384+                        if ((sp1 = strmemb(l->n_ap)) == NULL) {
388385                                 uerror("undefined struct or union");
 389386                                 break;
 390387                         }
 391388 
<>392 -                        sp = findmember(sp, r->n_name);
 393 -#ifdef notdef
 394 -                        name = r->n_name;
 395 -                        for (; sp != NULL; sp = sp->snext) {
 396 -                                if (sp->sname == name)
 397 -                                        break;
 398 -                        }
 399 -#endif
 400 -                        if (sp == NULL) {
  389+                        if ((sp = findmember(sp1, r->n_name)) == NULL) {
401390                                 uerror("member '%s' not declared", r->n_name);
 402391                                 break;
 403392                         }
     
 !
416405                         p->n_type = DECREF(l->n_type);
 417406                         p->n_qual = DECREF(l->n_qual);
 418407                         p->n_df = l->n_df;
<>419 -                        p->n_sue = l->n_sue;
  408+                        p->n_ap = l->n_ap;
420409                         break;
 421410 
 422411                 case ADDROF:
     
 !
431420                                 p->n_type = INCREF(l->n_type);
 432421                                 p->n_qual = INCQAL(l->n_qual);
 433422                                 p->n_df = l->n_df;
<>434 -                                p->n_sue = l->n_sue;
  423+                                p->n_ap = l->n_ap;
435424                                 break;
 436425 
 437426                         case COMOP:
     
 !
458447                 case LS:
 459448                 case RS: /* must make type size at least int... */
 460449                         if (p->n_type == CHAR || p->n_type == SHORT) {
<>461 -                                p->n_left = makety(l, INT, 0, 0, MKSUE(INT));
  450+                                p->n_left = makety(l, INT, 0, 0, MKAP(INT));
462451                         } else if (p->n_type == UCHAR || p->n_type == USHORT) {
 463452                                 p->n_left = makety(l, UNSIGNED, 0, 0,
<>464 -                                    MKSUE(UNSIGNED));
  453+                                    MKAP(UNSIGNED));
465454                         }
 466455                         l = p->n_left;
 467456                         p->n_type = l->n_type;
 468457                         p->n_qual = l->n_qual;
 469458                         p->n_df = l->n_df;
<>470 -                        p->n_sue = l->n_sue;
  459+                        p->n_ap = l->n_ap;
471460 
 472461                         /* FALLTHROUGH */
 473462                 case LSEQ:
 474463                 case RSEQ: /* ...but not for assigned types */
<>475 -                        if(tsize(r->n_type, r->n_df, r->n_sue) > SZINT)
 476 -                                p->n_right = makety(r, INT, 0, 0, MKSUE(INT));
  464+                        if(tsize(r->n_type, r->n_df, r->n_ap) > SZINT)
  465+                                p->n_right = makety(r, INT, 0, 0, MKAP(INT));
477466                         break;
 478467 
 479468                 case RETURN:
     
 !
484473                          * operator using STASG and
 485474                          * the addresses of left and right */
 486475 
<>487 -                        {
 488 -                                TWORD t;
 489 -                                union dimfun *d;
  476+                        if (strmemb(l->n_ap) != strmemb(r->n_ap))
  477+                                uerror("assignment of different structures");
490478 
<>491 -                                GETSUE(sue, l->n_sue);
 492 -                                GETSUE(sue2, r->n_sue);
 493 -                                if (sue->suem != sue2->suem)
 494 -                                        uerror("assignment of different structures");
  479+                        r = buildtree(ADDROF, r, NIL);
495480 
<>496 -                                r = buildtree(ADDROF, r, NIL);
 497 -                                t = r->n_type;
 498 -                                d = r->n_df;
 499 -                                sue = r->n_sue;
  481+                        l = block(STASG, l, r, r->n_type, r->n_df, r->n_ap);
  482+                        l = clocal(l);
500483 
<>501 -                                l = block(STASG, l, r, t, d, sue);
 502 -                                l = clocal(l);
  484+                        if( o == RETURN ){
  485+                                nfree(p);
  486+                                p = l;
  487+                                break;
  488+                        }
503489 
<>504 -                                if( o == RETURN ){
 505 -                                        nfree(p);
 506 -                                        p = l;
 507 -                                        break;
 508 -                                }
  490+                        p->n_op = UMUL;
  491+                        p->n_left = l;
  492+                        p->n_right = NIL;
  493+                        break;
509494 
<>510 -                                p->n_op = UMUL;
 511 -                                p->n_left = l;
 512 -                                p->n_right = NIL;
 513 -                                break;
 514 -                                }
515495                 case COLON:
 516496                         /* structure colon */
 517497 
<>518 -                        GETSUE(sue, l->n_sue);
 519 -                        GETSUE(sue2, r->n_sue);
 520 -                        if (sue->suem != sue2->suem)
  498+                        if (strmemb(l->n_ap) != strmemb(r->n_ap))
521499                                 uerror( "type clash in conditional" );
 522500                         break;
 523501 
     
 !
532510                         if (!ISFTN(p->n_type))
 533511                                 uerror("illegal function");
 534512                         p->n_type = DECREF(p->n_type);
<>535 -                        p->n_df = l->n_df;
 536 -                        p->n_sue = l->n_sue;
  513+                        p->n_df = l->n_df+1; /* add one for prototypes */
  514+                        p->n_ap = l->n_ap;
537515                         if (l->n_op == ADDROF && l->n_left->n_op == NAME &&
 538516                             l->n_left->n_sp != NULL && l->n_left->n_sp != NULL &&
 539517                             (l->n_left->n_sp->sclass == FORTRAN ||
     
 !
591569         for (; sp != NULL; sp = sp->snext) {
 592570                 if (sp->sname[0] == '*') {
 593571                         /* unnamed member, recurse down */
<>594 -                        if ((sp2 = findmember(sp->ssue->suem, s))) {
  572+                        if ((sp2 = findmember(strmemb(sp->sap), s))) {
595573                                 sp3 = tmpalloc(sizeof (struct symtab));
 596574                                 *sp3 = *sp2;
 597575                                 sp3->soffset += sp->soffset;
     
 !
624602 {
 625603         NODE *p;
 626604 
<>627 -        p = block(NAME, NIL, NIL, sp->stype, sp->sdf, sp->ssue);
  605+        p = block(NAME, NIL, NIL, sp->stype, sp->sdf, sp->sap);
628606         p->n_qual = sp->squal;
 629607         p->n_sp = sp;
 630608 
     
 !
644622         /* Get a label name */
 645623         if (sp->sflags == SLBLNAME) {
 646624                 p->n_type = VOID;
<>647 -                p->n_sue = MKSUE(VOID);
  625+                p->n_ap = MKAP(VOID);
648626         }
 649627 #endif
 650628         if (sp->stype == UNDEF) {
 651629                 uerror("%s undefined", sp->sname);
 652630                 /* make p look reasonable */
 653631                 p->n_type = INT;
<>654 -                p->n_sue = MKSUE(INT);
  632+                p->n_ap = MKAP(INT);
655633                 p->n_df = NULL;
 656634                 defid(p, SNULL);
 657635         }
     
 !
674652 {
 675653         NODE *q;
 676654 
<>677 -        q = block(NAME, NIL, NIL, t, 0, MKSUE(BTYPE(t)));
  655+        q = block(NAME, NIL, NIL, t, 0, MKAP(BTYPE(t)));
678656         q->n_qual = u;
 679657         q = buildtree(CAST, q, p);
 680658         p = q->n_right;
     
 !
687665  * Cast and complain if necessary by not inserining a cast.
 688666  */
 689667 NODE *
<>690 -ccast(NODE *p, TWORD t, TWORD u, union dimfun *df, struct suedef *sue)
  668+ccast(NODE *p, TWORD t, TWORD u, union dimfun *df, struct attr *ap)
691669 {
 692670         NODE *q;
 693671 
 694672         /* let buildtree do typechecking (and casting) */
<>695 -        q = block(NAME, NIL, NIL, t, df, sue);
  673+        q = block(NAME, NIL, NIL, t, df, ap);
696674         p = buildtree(ASSIGN, q, p);
 697675         nfree(p->n_left);
 698676         q = optim(p->n_right);
     
 !
729707                 }
 730708 
 731709         if( p->n_type == STRTY || p->n_type == UNIONTY ){
<>732 -                p = block(STARG, p, NIL, p->n_type, p->n_df, p->n_sue);
  710+                p = block(STARG, p, NIL, p->n_type, p->n_df, p->n_ap);
733711                 p->n_left = buildtree( ADDROF, p->n_left, NIL );
 734712                 p = clocal(p);
 735713                 }
     
 !
891869 #define NOTM(x) (~M(x))
 892870 #define SBIT(x) (1ULL << ((x)-1))
 893871 
<>894 -        r = v & M(btdims[t].suesize);
 895 -        if (!ISUNSIGNED(t) && (SBIT(btdims[t].suesize) & r))
 896 -                r = r | NOTM(btdims[t].suesize);
  872+        r = v & M(btattr[t].atypsz);
  873+        if (!ISUNSIGNED(t) && (SBIT(btattr[t].atypsz) & r))
  874+                r = r | NOTM(btattr[t].atypsz);
897875         return r;
 898876 }
 899877 
     
 !
957935                 if (q->n_op != ICON || q->n_lval != 0)
 958936                         werror("illegal combination of pointer and integer");
 959937         } else {
<>960 -                d1 = p->n_left->n_df;
 961 -                d2 = p->n_right->n_df;
962938                 if (t1 == t2) {
<>963 -                        struct suedef *s1, *s2;
 964 -
 965 -                        GETSUE(s1, p->n_left->n_sue);
 966 -                        GETSUE(s2, p->n_right->n_sue);
 967 -                        if (s1->suem != s2->suem)
  939+                        if (ISSOU(BTYPE(t1)) &&
  940+                            !suemeq(p->n_left->n_ap, p->n_right->n_ap))
968941                                 werror("illegal structure pointer combination");
 969942                         return;
 970943                 }
<> 944+                d1 = p->n_left->n_df;
  945+                d2 = p->n_right->n_df;
971946                 for (;;) {
 972947                         if (ISARY(t1) || ISPTR(t1)) {
 973948                                 if (!ISARY(t2) && !ISPTR(t2))
     
 !
1002977 stref(NODE *p)
 1003978 {
 1004979         NODE *r;
<>1005 -        struct suedef *sue;
  980+        struct attr *ap;
1006981         union dimfun *d;
 1007982         TWORD t, q;
 1008983         int dsc;
     
 !
10261001         t = INCREF(s->stype);
 10271002         q = INCQAL(s->squal);
 10281003         d = s->sdf;
<>1029 -        sue = s->ssue;
  1004+        ap = s->sap;
10301005 
<>1031 -        p = makety(p, t, q, d, sue);
  1006+        p = makety(p, t, q, d, ap);
10321007 
 10331008         /* compute the offset to be added */
 10341009 
     
 !
10421017          * LHS and RHS accesses are different, so must delay
 10431018          * it until we know.  Do the bitfield construct here though.
 10441019          */
<>1045 -        if ((dsc & FIELD) == 0 && (off % talign(s->stype, s->ssue))) {
  1020+        if ((dsc & FIELD) == 0 && (off % talign(s->stype, s->sap))) {
10461021 #if 0
<>1047 -                int sz = tsize(s->stype, s->sdf, s->ssue);
 1048 -                int al = talign(s->stype, s->ssue);
  1022+                int sz = tsize(s->stype, s->sdf, s->sap);
  1023+                int al = talign(s->stype, s->sap);
10491024                 int sz1 = al - (off % al);
 10501025 #endif
 10511026         }
 10521027 #endif
 10531028 
 10541029         if (dsc & FIELD) {  /* make fields look like ints */
 10551030                 off = (off/ALINT)*ALINT;
<>1056 -                sue = MKSUE(INT);
  1031+                ap = MKAP(INT);
10571032         }
 10581033         if (off != 0) {
<>1059 -                p = block(PLUS, p, offcon(off, t, d, sue), t, d, sue);
  1034+                p = block(PLUS, p, offcon(off, t, d, ap), t, d, ap);
10601035                 p->n_qual = q;
 10611036                 p = optim(p);
 10621037         }
     
 !
10661041         /* if field, build field info */
 10671042 
 10681043         if (dsc & FIELD) {
<>1069 -                p = block(FLD, p, NIL, s->stype, 0, s->ssue);
  1044+                p = block(FLD, p, NIL, s->stype, 0, s->sap);
10701045                 p->n_qual = q;
 10711046                 p->n_rval = PKFIELD(dsc&FLDSIZ, s->soffset%ALINT);
 10721047         }
     
 !
11141089 {
 11151090         NODE *p;
 11161091 
<>1117 -        p = block(ICON, NIL, NIL, type, 0, MKSUE(type));
  1092+        p = block(ICON, NIL, NIL, type, 0, MKAP(type));
11181093         p->n_lval = val;
 11191094         p->n_sp = sp;
 11201095         return clocal(p);
     
 !
11231098 NODE *
 11241099 bpsize(NODE *p)
 11251100 {
<>1126 -        return(offcon(psize(p), p->n_type, p->n_df, p->n_sue));
  1101+        return(offcon(psize(p), p->n_type, p->n_df, p->n_ap));
11271102 }
 11281103 
 11291104 /*
     
 !
11391114                 return(SZINT);
 11401115         }
 11411116         /* note: no pointers to fields */
<>1142 -        return(tsize(DECREF(p->n_type), p->n_df, p->n_sue));
  1117+        return(tsize(DECREF(p->n_type), p->n_df, p->n_ap));
11431118 }
 11441119 
 11451120 /*
     
 !
11671142         while (ISARY(ty))
 11681143                 ty = DECREF(ty);
 11691144 
<>1170 -        r = offcon(tsize(ty, s->n_df, s->n_sue), s->n_type, s->n_df, s->n_sue);
  1145+        r = offcon(tsize(ty, s->n_df, s->n_ap), s->n_type, s->n_df, s->n_ap);
11711146         ty = ty2;
 11721147         rv = bcon(1);
 11731148         df = s->n_df;
 11741149         while (ISARY(ty)) {
 11751150                 rv = buildtree(MUL, rv, df->ddim >= 0 ? bcon(df->ddim) :
<>1176 -                    tempnode(-df->ddim, INT, 0, MKSUE(INT)));
  1151+                    tempnode(-df->ddim, INT, 0, MKAP(INT)));
11771152                 df++;
 11781153                 ty = DECREF(ty);
 11791154         }
<>1180 -        rv = clocal(block(PMCONV, rv, r, INT, 0, MKSUE(INT)));
  1155+        rv = clocal(block(PMCONV, rv, r, INT, 0, MKAP(INT)));
11811156         rv = optim(rv);
 11821157 
<>1183 -        r = block(PMCONV, q, rv, INT, 0, MKSUE(INT));
  1158+        r = block(PMCONV, q, rv, INT, 0, MKAP(INT));
11841159         r = clocal(r);
 11851160         /*
 11861161          * Indexing is only allowed with integer arguments, so insert
 11871162          * SCONV here if arg is not an integer.
 11881163          * XXX - complain?
 11891164          */
 11901165         if (r->n_type != INTPTR)
<>1191 -                r = clocal(block(SCONV, r, NIL, INTPTR, 0, MKSUE(INTPTR)));
  1166+                r = clocal(block(SCONV, r, NIL, INTPTR, 0, MKAP(INTPTR)));
11921167         if (f == CVTL)
 11931168                 p->n_left = r;
 11941169         else
     
 !
12341209 
 12351210         case MINUS:
 12361211                 returnclocal( block( PVCONV,
<>1237 -                        p, bpsize(p->n_left), INT, 0, MKSUE(INT))));
  1212+                        p, bpsize(p->n_left), INT, 0, MKAP(INT))));
12381213                 }
 12391214 
 12401215         cerror( "illegal oconvert: %d", p->n_op );
     
 !
12511226 NODE *
 12521227 ptmatch(NODE *p)
 12531228 {
<>1254 -        struct suedef *sue, *sue2;
  1229+        struct attr *ap, *ap2;
12551230         union dimfun *d, *d2;
 12561231         TWORD t1, t2, t, q1, q2, q;
 12571232         int o;
     
 !
12631238         q2 = p->n_right->n_qual;
 12641239         d = p->n_left->n_df;
 12651240         d2 = p->n_right->n_df;
<>1266 -        sue = p->n_left->n_sue;
 1267 -        sue2 = p->n_right->n_sue;
  1241+        ap = p->n_left->n_ap;
  1242+        ap2 = p->n_right->n_ap;
12681243 
 12691244         switch( o ){
 12701245 
     
 !
12981273                         t = t2;
 12991274                         q = q2;
 13001275                         d = d2;
<>1301 -                        sue = sue2;
  1276+                        ap = ap2;
13021277                         break;
 13031278                         }
 13041279                 if( !ISPTR(t2) ){
 13051280                         break;
 13061281                         }
 13071282 
 13081283                 /* both are pointers */
<>1309 -                if( talign(t2,sue2) < talign(t,sue) ){
  1284+                if( talign(t2,ap2) < talign(t,ap) ){
13101285                         t = t2;
 13111286                         q = q2;
<>1312 -                        sue = sue2;
  1287+                        ap = ap2;
13131288                         }
 13141289                 break;
 13151290                 }
 13161291 
<>1317 -        p->n_left = makety( p->n_left, t, q, d, sue );
 1318 -        p->n_right = makety( p->n_right, t, q, d, sue );
  1292+        p->n_left = makety( p->n_left, t, q, d, ap );
  1293+        p->n_right = makety( p->n_right, t, q, d, ap );
13191294         if( o!=MINUS && !clogop(o) ){
 13201295 
 13211296                 p->n_type = t;
 13221297                 p->n_qual = q;
 13231298                 p->n_df = d;
<>1324 -                p->n_sue = sue;
  1299+                p->n_ap = ap;
13251300                 }
 13261301 
 13271302         return(clocal(p));
     
 !
14061381 
 14071382         if (t != t1 || (ru && !lu)) {
 14081383                 if (Wtruncate && o != CAST && p->n_right->n_op != ICON &&
<>1409 -                    tsize(t1, 0, MKSUE(t2)) > tsize(tu, 0, MKSUE(tu)))
  1384+                    tsize(t1, 0, MKAP(t2)) > tsize(tu, 0, MKAP(tu)))
14101385                         werror("conversion to '%s' from '%s' may alter its value",
 14111386                             tnames[tu], tnames[t1]);
<>1412 -                p->n_left = makety( p->n_left, tu, 0, 0, MKSUE(tu));
  1387+                p->n_left = makety( p->n_left, tu, 0, 0, MKAP(tu));
14131388         }
 14141389 
 14151390         if (t != t2 || o==CAST || (lu && !ru)) {
 14161391                 if (Wtruncate && o != CAST && p->n_right->n_op != ICON &&
<>1417 -                    tsize(t2, 0, MKSUE(t2)) > tsize(tu, 0, MKSUE(tu)))
  1392+                    tsize(t2, 0, MKAP(t2)) > tsize(tu, 0, MKAP(tu)))
14181393                         werror("conversion to '%s' from '%s' may alter its value",
 14191394                             tnames[tu], tnames[t2]);
<>1420 -                p->n_right = makety(p->n_right, tu, 0, 0, MKSUE(tu));
  1395+                p->n_right = makety(p->n_right, tu, 0, 0, MKAP(tu));
14211396         }
 14221397 
 14231398         if( casgop(o) ){
 14241399                 p->n_type = p->n_left->n_type;
 14251400                 p->n_df = p->n_left->n_df;
<>1426 -                p->n_sue = p->n_left->n_sue;
  1401+                p->n_ap = p->n_left->n_ap;
14271402                 }
 14281403         else if( !clogop(o) ){
 14291404                 p->n_type = tu;
 14301405                 p->n_df = NULL;
<>1431 -                p->n_sue = MKSUE(t);
  1406+                p->n_ap = MKAP(t);
14321407                 }
 14331408 
 14341409 #ifdef PCC_DEBUG
     
 !
14531428 static NODE *
 14541429 fzero(TWORD t)
 14551430 {
<>1456 -        NODE *p = block(FCON, NIL, NIL, t, 0, MKSUE(t));
  1431+        NODE *p = block(FCON, NIL, NIL, t, 0, MKAP(t));
14571432 
 14581433         p->n_dcon = FLOAT_CAST(0, INT);
 14591434         return p;
     
 !
14631438  * make p into type t by inserting a conversion
 14641439  */
 14651440 NODE *
<>1466 -makety(NODE *p, TWORD t, TWORD q, union dimfun *d, struct suedef *sue)
  1441+makety(NODE *p, TWORD t, TWORD q, union dimfun *d, struct attr *ap)
14671442 {
 14681443 
 14691444         if (t == p->n_type) {
 14701445                 p->n_df = d;
<>1471 -                p->n_sue = sue;
  1446+                p->n_ap = ap;
14721447                 p->n_qual = q;
 14731448                 return(p);
 14741449         }
     
 !
14931468                                 p->n_type = t;
 14941469                                 p->n_qual = q;
 14951470                                 p->n_df = d;
<>1496 -                                p->n_sue = sue;
  1471+                                p->n_ap = ap;
14971472                                 return(p);
 14981473                         } else if (isf == ISITY(p->n_type)) {
 14991474                                 /* will be zero */
     
 !
15081483                                 p->n_type = t + (IMAG-COMPLEX);
 15091484                                 p->n_qual = q;
 15101485                                 p->n_df = d;
<>1511 -                                p->n_sue = MKSUE(p->n_type);
 1512 -                                return block(CM, r, p, t, 0, MKSUE(t));
  1486+                                p->n_ap = MKAP(p->n_type);
  1487+                                return block(CM, r, p, t, 0, MKAP(t));
15131488                         } else if (ISFTY(p->n_type)) {
 15141489                                 /* convert to correct subtype */
 15151490                                 r = fzero(t + (IMAG-COMPLEX));
 15161491                                 p->n_type = t - (COMPLEX-DOUBLE);
 15171492                                 p->n_qual = q;
 15181493                                 p->n_df = d;
<>1519 -                                p->n_sue = MKSUE(p->n_type);
 1520 -                                return block(CM, p, r, t, 0, MKSUE(t));
  1494+                                p->n_ap = MKAP(p->n_type);
  1495+                                return block(CM, p, r, t, 0, MKAP(t));
15211496                         } else if (ISCTY(p->n_type))
 15221497                                 cerror("complex constant2");
 15231498                 }
 15241499         }
 15251500 
 15261501         if (t & TMASK) {
 15271502                 /* non-simple type */
<>1528 -                p = block(PCONV, p, NIL, t, d, sue);
  1503+                p = block(PCONV, p, NIL, t, d, ap);
15291504                 p->n_qual = q;
 15301505                 return clocal(p);
 15311506         }
     
 !
15361511                         p->n_dcon = FLOAT_CAST(p->n_lval, p->n_type);
 15371512                         p->n_type = t;
 15381513                         p->n_qual = q;
<>1539 -                        p->n_sue = MKSUE(t);
  1514+                        p->n_ap = MKAP(t);
15401515                         return (clocal(p));
 15411516                 } else if (ISCTY(t) || ISITY(t))
 15421517                         cerror("complex constant3");
 15431518         }
 15441519 
<>1545 -        p = block(SCONV, p, NIL, t, d, sue);
  1520+        p = block(SCONV, p, NIL, t, d, ap);
15461521         p->n_qual = q;
 15471522         return clocal(p);
 15481523 
 15491524 }
 15501525 
 15511526 NODE *
<>1552 -block(int o, NODE *l, NODE *r, TWORD t, union dimfun *d, struct suedef *sue)
  1527+block(int o, NODE *l, NODE *r, TWORD t, union dimfun *d, struct attr *ap)
15531528 {
 15541529         register NODE *p;
 15551530 
     
 !
15621537         p->n_type = t;
 15631538         p->n_qual = 0;
 15641539         p->n_df = d;
<>1565 -        p->n_sue = sue;
  1540+        p->n_ap = ap;
15661541 #if !defined(MULTIPASS)
 15671542         /* p->n_reg = */p->n_su = 0;
 15681543         p->n_regw = 0;
     
 !
18121787  * If nr == 0, return a node with a new number.
 18131788  */
 18141789 NODE *
<>1815 -tempnode(int nr, TWORD type, union dimfun *df, struct suedef *sue)
  1790+tempnode(int nr, TWORD type, union dimfun *df, struct attr *ap)
18161791 {
 18171792         NODE *r;
 18181793 
<>1819 -        r = block(TEMP, NIL, NIL, type, df, sue);
  1794+        r = block(TEMP, NIL, NIL, type, df, ap);
18201795         regno(r) = nr ? nr : tvaloff;
 18211796         tvaloff += szty(type);
 18221797         return r;
     
 !
18531828                         if (arrstkp)
 18541829                                 q = arrstk[astkp++];
 18551830                         else
<>1856 -                                q = tempnode(-df->ddim, INT, 0, MKSUE(INT));
  1831+                                q = tempnode(-df->ddim, INT, 0, MKAP(INT));
18571832                 } else
 18581833                         q = bcon(df->ddim);
 18591834                 rv = buildtree(MUL, rv, q);
 18601835                 df++;
 18611836                 ty = DECREF(ty);
 18621837         }
<>1863 -        rv = buildtree(MUL, rv, bcon(tsize(ty, p->n_df, p->n_sue)/SZCHAR));
  1838+        rv = buildtree(MUL, rv, bcon(tsize(ty, p->n_df, p->n_ap)/SZCHAR));
18641839         tfree(p);
 18651840         arrstkp = 0; /* XXX - may this fail? */
 18661841         return rv;
     
 !
18901865                     p->n_rval : 0);
 18911866         }
 18921867         tprint(stdout, p->n_type, p->n_qual);
<>1893 -        printf( ", %p, %p\n", p->n_df, p->n_sue );
  1868+        printf( ", %p, ", p->n_df);
  1869+        dump_attr(p->n_ap);
18941870 }
 18951871 # endif
 18961872 
     
 !
21312107         o = p->n_op;
 21322108         ty = coptype(o);
 21332109         if (BTYPE(p->n_type) == ENUMTY) { /* fixup enum */
<>2134 -                MODTYPE(p->n_type, p->n_sue->suem->stype);
  2110+                struct symtab *sp = strmemb(p->n_ap);
  2111+                MODTYPE(p->n_type, sp->stype);
21352112                 /*
 21362113                  * XXX may fail if these are true:
 21372114                  * - variable-sized enums
     
 !
21552132                 q = p->n_right->n_left;
 21562133                 comops(q);
 21572134                 if (type != VOID) {
<>2158 -                        r = tempnode(0, q->n_type, q->n_df, q->n_sue);
  2135+                        r = tempnode(0, q->n_type, q->n_df, q->n_ap);
21592136                         tval = regno(r);
 21602137                         q = buildtree(ASSIGN, r, q);
 21612138                 }
     
 !
21672144                 q = p->n_right->n_right;
 21682145                 comops(q);
 21692146                 if (type != VOID) {
<>2170 -                        r = tempnode(tval, q->n_type, q->n_df, q->n_sue);
  2147+                        r = tempnode(tval, q->n_type, q->n_df, q->n_ap);
21712148                         q = buildtree(ASSIGN, r, q);
 21722149                 }
 21732150                 rmcops(q);
     
 !
21772154 
 21782155                 nfree(p->n_right);
 21792156                 if (p->n_type != VOID) {
<>2180 -                        r = tempnode(tval, p->n_type, p->n_df, p->n_sue);
  2157+                        r = tempnode(tval, p->n_type, p->n_df, p->n_ap);
21812158                         *p = *r;
 21822159                         nfree(r);
 21832160                 } else {
     
 !
22062183                 r = talloc();
 22072184                 *r = *p;
 22082185                 andorbr(r, -1, lbl = getlab());
<>2209 -                q = tempnode(0, p->n_type, p->n_df, p->n_sue);
  2186+                q = tempnode(0, p->n_type, p->n_df, p->n_ap);
22102187                 tval = regno(q);
<>2211 -                r = tempnode(tval, p->n_type, p->n_df, p->n_sue);
  2188+                r = tempnode(tval, p->n_type, p->n_df, p->n_ap);
22122189                 ecode(buildtree(ASSIGN, q, bcon(1)));
 22132190                 branch(lbl2 = getlab());
 22142191                 plabel( lbl);
 22152192                 ecode(buildtree(ASSIGN, r, bcon(0)));
 22162193                 plabel( lbl2);
<>2217 -                r = tempnode(tval, p->n_type, p->n_df, p->n_sue);
  2194+                r = tempnode(tval, p->n_type, p->n_df, p->n_ap);
22182195                 *p = *r;
 22192196                 nfree(r);
 22202197 #endif
     
 !
22822259                 NODE *ll = l->n_left;
 22832260 
 22842261                 if (has_se(l)) {
<>2285 -                        q = tempnode(0, ll->n_type, ll->n_df, ll->n_sue);
  2262+                        q = tempnode(0, ll->n_type, ll->n_df, ll->n_ap);
22862263                         tval = regno(q);
<>2287 -                        r = tempnode(tval, ll->n_type, ll->n_df,ll->n_sue);
  2264+                        r = tempnode(tval, ll->n_type, ll->n_df,ll->n_ap);
22882265                         l->n_left = q;
 22892266                         /* Now the left side of node p has no side effects. */
 22902267                         /* side effects on the right side must be obeyed */
     
 !
22992276                             p->n_right);
 23002277 #else
 23012278                         p->n_right = block(UNASG p->n_op, ccopy(l),
<>2302 -                            p->n_right, p->n_type, p->n_df, p->n_sue);
  2279+                            p->n_right, p->n_type, p->n_df, p->n_ap);
23032280 #endif
 23042281                         p->n_op = ASSIGN;
 23052282                         p->n_right = delasgop(p->n_right);
     
 !
23952372 
 23962373                 /* note: p->left not a field... */
 23972374                 printf(CONFMT, (CONSZ)tsize(STRTY, p->n_left->n_df,
<>2398 -                    p->n_left->n_sue));
 2399 -                printf("\t%d\t\n", talign(STRTY, p->n_left->n_sue));
  2375+                    p->n_left->n_ap));
  2376+                printf("\t%d\t\n", talign(STRTY, p->n_left->n_ap));
24002377                 break;
 24012378 
 24022379         case XARG:
     
 !
24572434                 /* STASG used for stack array init */
 24582435                 if (ISARY(p->n_type)) {
 24592436                         int size1 = (int)tsize(p->n_type, p->n_left->n_df,
<>2460 -                            p->n_left->n_sue)/SZCHAR;
  2437+                            p->n_left->n_ap)/SZCHAR;
24612438                         p->n_stsize = (int)tsize(p->n_type, p->n_right->n_df,
<>2462 -                            p->n_right->n_sue)/SZCHAR;
  2439+                            p->n_right->n_ap)/SZCHAR;
24632440                         if (size1 < p->n_stsize)
 24642441                                 p->n_stsize = size1;
 24652442                         p->n_stalign = talign(p->n_type,
<>2466 -                            p->n_left->n_sue)/SZCHAR;
  2443+                            p->n_left->n_ap)/SZCHAR;
24672444                         break;
 24682445                 }
 24692446                 /* FALLTHROUGH */
     
 !
24722449         case USTCALL:
 24732450                 /* set up size parameters */
 24742451                 p->n_stsize = (int)((tsize(STRTY, p->n_left->n_df,
<>2475 -                    p->n_left->n_sue)+SZCHAR-1)/SZCHAR);
 2476 -                p->n_stalign = talign(STRTY,p->n_left->n_sue)/SZCHAR;
  2452+                    p->n_left->n_ap)+SZCHAR-1)/SZCHAR);
  2453+                p->n_stalign = talign(STRTY,p->n_left->n_ap)/SZCHAR;
24772454                 if (p->n_stalign == 0)
 24782455                         p->n_stalign = 1; /* At least char for packed structs */
 24792456                 break;
     
 !
25102487                         q = talloc();
 25112488                         *q = *p;
 25122489                         q->n_type = BOOL_TYPE;
<>2513 -                        r = tempnode(0, BOOL_TYPE, NULL, MKSUE(BOOL_TYPE));
  2490+                        r = tempnode(0, BOOL_TYPE, NULL, MKAP(BOOL_TYPE));
25142491                         val = regno(r);
<>2515 -                        s = tempnode(val, BOOL_TYPE, NULL, MKSUE(BOOL_TYPE));
  2492+                        s = tempnode(val, BOOL_TYPE, NULL, MKAP(BOOL_TYPE));
25162493                         *p = *s;
 25172494                         q = buildtree(ASSIGN, r, q);
 25182495                         cbranch(buildtree(EQ, q, bcon(0)), bcon(l = getlab()));
     
 !
25392516                 if (q->n_op == UMUL)
 25402517                         q = p->n_left;
 25412518                 if (cdope(q->n_op)&CALLFLG &&
<>2542 -                    gcc_get_attr(q->n_sue, GCC_ATYP_WARN_UNUSED_RESULT))
  2519+                    attr_find(q->n_ap, GCC_ATYP_WARN_UNUSED_RESULT))
25432520                         werror("return value ignored");
 25442521         }
 25452522 #endif
     
 !
27702747         if ((n->n_type >= CHAR && n->n_type < INT) || n->n_type == BOOL) {
 27712748                 if ((n->n_type == UCHAR && MAX_UCHAR > MAX_INT) ||
 27722749                     (n->n_type == USHORT && MAX_USHORT > MAX_INT))
<>2773 -                        return makety(n, UNSIGNED, 0, 0, MKSUE(UNSIGNED));
 2774 -                return makety(n, INT, 0, 0, MKSUE(INT));
  2750+                        return makety(n, UNSIGNED, 0, 0, MKAP(UNSIGNED));
  2751+                return makety(n, INT, 0, 0, MKAP(INT));
<_27752752         }
 27762753         return n;
 27772754 }
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-21 02:55 +0100