Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.13
 
1.14
 
MAIN:ragge:20080106160559
 
local.c
_>348348 void
 349349 myp2tree(NODE *p)
 350350 {
<>351 -        int o = p->n_op, i;
  351+        struct symtab *sp;
352352 
<>353 -        if (o != FCON)
  353+        if (p->n_op != FCON)
354354                 return;
 355355 
 356356         /* Write float constants to memory */
<>357 -        /* Should be volontary per architecture */
358357  
<>359 -        setloc1(RDATA);
 360 -        defalign(p->n_type == FLOAT ? ALFLOAT : p->n_type == DOUBLE ?
 361 -            ALDOUBLE : ALLDOUBLE );
 362 -        deflab1(i = getlab());
  358+        sp = tmpalloc(sizeof(struct symtab));
  359+        sp->sclass = STATIC;
  360+        sp->slevel = 1; /* fake numeric label */
  361+        sp->soffset = getlab();
  362+        sp->sflags = 0;
  363+        sp->stype = p->n_type;
  364+        sp->squal = (CON >> TSHIFT);
  365+
  366+        defloc(sp);
363367         ninval(0, btdims[p->n_type].suesize, p);
<> 368+
364369         p->n_op = NAME;
<>365 -        p->n_lval = 0;  
 366 -        p->n_sp = tmpalloc(sizeof(struct symtab_hdr));
 367 -        p->n_sp->sclass = ILABEL;
 368 -        p->n_sp->soffset = i;
 369 -        p->n_sp->sflags = 0;
  370+        p->n_lval = 0;
  371+        p->n_sp = sp;
370372 
 371373 }
 372374 
     
 !
583585 {
 584586 }
 585587 
<> 588+/*
  589+ * Print out a string of characters.
  590+ * Assume that the assembler understands C-style escape
  591+ * sequences.
  592+ */
  593+void
  594+instring(struct symtab *sp)
  595+{
  596+        char *s, *str;
  597+
  598+        defloc(sp);
  599+        str = sp->sname;
  600+
  601+        /* be kind to assemblers and avoid long strings */
  602+        printf("\t.ascii \"");
  603+        for (s = str; *s != 0; ) {
  604+                if (*s++ == '\\') {
  605+                        (void)esccon(&s);
  606+                }
  607+                if (s - str > 60) {
  608+                        fwrite(str, 1, s - str, stdout);
  609+                        printf("\"\n\t.ascii \"");
  610+                        str = s;
  611+                }
  612+        }
  613+        fwrite(str, 1, s - str, stdout);
  614+        printf("\\0\"\n");
  615+}
  616+
  617+/*
  618+ * Print out a wide string by calling ninval().
  619+ */
  620+void
  621+inwstring(struct symtab *sp)
  622+{
  623+        char *s = sp->sname;
  624+        NODE *p;
  625+
  626+        defloc(sp);
  627+        p = bcon(0);
  628+        do {
  629+                if (*s++ == '\\')
  630+                        p->n_lval = esccon(&s);
  631+                else
  632+                        p->n_lval = (unsigned char)s[-1];
  633+                ninval(0, (MKSUE(WCHAR_TYPE))->suesize, p);
  634+        } while (s[-1] != 0);
  635+        nfree(p);
  636+}
  637+
586638 /* make a common declaration for id, if reasonable */
 587639 void
<> 640+defzero(struct symtab *sp)
  641+{
  642+        int off;
  643+
  644+        off = tsize(sp->stype, sp->sdf, sp->ssue);
  645+        off = (off+(SZCHAR-1))/SZCHAR;
  646+        printf("        .%scomm ", sp->sclass == STATIC ? "l" : "");
  647+        if (sp->slevel == 0)
  648+                printf("%s,0%o\n", exname(sp->soname), off);
  649+        else
  650+                printf(LABFMT ",0%o\n", sp->soffset, off);
  651+}
  652+
  653+
  654+#ifdef notdef
  655+/* make a common declaration for id, if reasonable */
  656+void
588657 commdec(struct symtab *q)
 589658 {
 590659         int off;
     
 !
637706         if (locc == STRNG)
 638707                 printf("\t.align 2\n");
 639708 }
<> 709+#endif
<_640710 
 641711 /*
 642712  * Initialize a bitfield.
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-08-23 01:36 +0200