Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.15
 
1.16
 
MAIN:ragge:20110623134823
 
local.c
_>111111         inherit:
 112112                 p->n_left->n_type = p->n_type;
 113113                 p->n_left->n_df = p->n_df;
<>114 -                p->n_left->n_sue = p->n_sue;
  114+                p->n_left->n_ap = p->n_ap;
115115                 r = p->n_left;
 116116                 nfree(p);
 117117                 return( r );
     
 !
193193                             r->n_right->n_op != FUNARG)
 194194                                 r->n_right = block(FUNARG, r->n_right, NIL,
 195195                                     r->n_right->n_type, r->n_right->n_df,
<>196 -                                    r->n_right->n_sue);
  196+                                    r->n_right->n_ap);
197197                 }
 198198                 if (r->n_op != STARG && r->n_op != FUNARG) {
 199199                         NODE *l = talloc();
     
 !
210210 myp2tree(NODE *p)
 211211 {
 212212         struct symtab *sp;
<>213 -        int o = p->n_op, i;
214213 
<>215 -        if (o != FCON)
  214+        if (p->n_op != FCON)
216215                 return;
 217216 
 218217         sp = inlalloc(sizeof(struct symtab));
 219218         sp->sclass = STATIC;
<>220 -        sp->ssue = 0;
  219+        sp->sap = 0;
221220         sp->slevel = 1; /* fake numeric label */
 222221         sp->soffset = getlab();
 223222         sp->sflags = 0;
 224223         sp->stype = p->n_type;
 225224         sp->squal = (CON >> TSHIFT);
 226225 
 227226         defloc(sp);
<>228 -        ninval(0, sp->ssue->suesize, p);
  227+        inval(0, tsize(sp->stype, sp->sdf, sp->sap), p);
229228 
 230229         p->n_op = NAME;
 231230         p->n_lval = 0;
     
 !
293292 {
 294293 }
 295294 
<> 295+/* make a common declaration for id, if reasonable */
296296 void
<>297 -commdec( struct symtab *q ){ /* make a common declaration for id, if reasonable */
 298 -        OFFSZ off;
 299 -
 300 -        printf( "       .comm   %s,", q->soname ? q->soname : exname( q->sname ) );
 301 -        off = tsize( q->stype, q->sdf, q->ssue );
 302 -        printf( CONFMT, off/SZCHAR );
 303 -        printf( "\n" );
 304 -        }
 305 -
 306 -/* make a local common declaration for id, if reasonable */
 307 -void
 308 -lcommdec(struct symtab *q)
  297+defzero(struct symtab *sp)
309298 {
<>310 -        int off;
  299+        int off, al;
  300+        char *name;
311301 
<>312 -        off = tsize(q->stype, q->sdf, q->ssue);
 313 -        off = (off+(SZCHAR-1))/SZCHAR;
 314 -        if (q->slevel == 0)
 315 -                printf("        .lcomm %s,0%o\n", q->soname ? q->soname : exname(q->sname), off);
 316 -        else
 317 -                printf("        .lcomm " LABFMT ",0%o\n", q->soffset, off);
 318 -}
  302+        if ((name = sp->soname) == NULL)
  303+                name = exname(sp->sname);
  304+        off = tsize(sp->stype, sp->sdf, sp->sap);
  305+        SETOFF(off,SZCHAR);
  306+        off /= SZCHAR;
  307+        al = talign(sp->stype, sp->sap)/SZCHAR;
319308 
<>320 -
 321 -static char *loctbl[] = { "text", "data", "section .rodata", "section .rodata" };
 322 -
 323 -void
 324 -setloc1(int locc)
 325 -{
 326 -        if (locc == lastloc)
 327 -                return;
 328 -        lastloc = locc;
 329 -        printf("        .%s\n", loctbl[locc]);
  309+        if (sp->sclass == STATIC)
  310+                printf("\t.local %s\n", name);
  311+        if (sp->slevel == 0) {
  312+                printf("\t.comm %s,0%o,%d\n", name, off, al);
  313+        } else
  314+                printf("\t.comm " LABFMT ",0%o,%d\n", sp->soffset, off, al);
330315 }
 331316 
 332317 /*
     
 !
340325 ninval(CONSZ off, int fsz, NODE *p)
 341326 {
 342327         union { float f; double d; long double l; int i[3]; } u;
<>343 -        struct symtab *q;
 344 -        TWORD t;
345328 
<>346 -        t = p->n_type;
 347 -        if (t > BTMASK)
 348 -                p->n_type = t = INT; /* pointer */
 349 -
 350 -        if (p->n_op == ICON && p->n_sp != NULL && DEUNSIGN(t) != INT)
 351 -                uerror("element not constant");
 352 -
 353 -        switch (t) {
 354 -        case LONGLONG:
 355 -        case ULONGLONG:
 356 -                printf("\t.long 0x%x", (int)p->n_lval);
 357 -                printf("\t.long 0x%x", (int)(p->n_lval >> 32));
 358 -                break;
 359 -        case INT:
 360 -        case UNSIGNED:
 361 -                printf("\t.long 0x%x", (int)p->n_lval);
 362 -                if ((q = p->n_sp) != NULL) {
 363 -                        if ((q->sclass == STATIC && q->slevel > 0)) {
 364 -                                printf("+" LABFMT, q->soffset);
 365 -                        } else
 366 -                                printf("+%s", q->soname ? q->soname : exname(q->sname));
 367 -                }
 368 -                printf("\n");
 369 -                break;
  329+        switch (p->n_type) {
<_370330         case LDOUBLE:
 371331                 u.i[2] = 0;
 372332                 u.l = (long double)p->n_dcon;
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-11-01 14:27 +0100