Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.69
 
1.70
 
MAIN:ragge:20080106151041
 
local.c
_>497497 myp2tree(NODE *p)
 498498 {
 499499         struct symtab *sp;
<>500 -        int i;
501500 
 502501         if (kflag)
 503502                 walkf(p, fixnames); /* XXX walkf not needed */
 504503         if (p->n_op != FCON)
 505504                 return;
 506505 
<> 506+#if 0
507507         /* put floating constants in memory */
 508508         setloc1(RDATA);
 509509         defalign(ALLDOUBLE);
 510510         deflab1(i = getlab());
 511511         ninval(0, btdims[p->n_type].suesize, p);
<> 512+#endif
512513 
 513514         sp = IALLOC(sizeof(struct symtab));
 514515         sp->sclass = STATIC;
 515516         sp->slevel = 1; /* fake numeric label */
<>516 -        sp->soffset = i;
  517+        sp->soffset = getlab();
517518         sp->sflags = 0;
<> 519+        sp->stype = p->n_type;
  520+        sp->squal = (CON >> TSHIFT);
518521 
<> 522+        defloc(sp);
  523+        ninval(0, btdims[p->n_type].suesize, p);
  524+
519525         p->n_op = NAME;
 520526         p->n_lval = 0;
 521527         p->n_sp = sp;
     
 !
602608 /*
 603609  * Print out a string of characters.
 604610  * Assume that the assembler understands C-style escape
<>605 - * sequences.  Location is already set.
  611+ * sequences.
606612  */
 607613 void
<>608 -instring(char *str)
  614+instring(struct symtab *sp)
609615 {
<>610 -        char *s;
  616+        char *s, *str;
611617 
<> 618+        defloc(sp);
  619+        str = sp->sname;
  620+
612621         /* be kind to assemblers and avoid long strings */
 613622         printf("\t.ascii \"");
 614623         for (s = str; *s != 0; ) {
 615624                 if (*s++ == '\\') {
 616625                         (void)esccon(&s);
 617626                 }
<>618 -                if (s - str > 64) {
  627+                if (s - str > 60) {
619628                         fwrite(str, 1, s - str, stdout);
 620629                         printf("\"\n\t.ascii \"");
 621630                         str = s;
     
 !
625634         printf("\\0\"\n");
 626635 }
 627636 
<> 637+/*
  638+ * Print out a wide string by calling ninval().
  639+ */
  640+void
  641+inwstring(struct symtab *sp)
  642+{
  643+        char *s = sp->sname;
  644+        NODE *p;
  645+
  646+        defloc(sp);
  647+        p = bcon(0);
  648+        do {
  649+                if (*s++ == '\\')
  650+                        p->n_lval = esccon(&s);
  651+                else
  652+                        p->n_lval = (unsigned char)s[-1];
  653+                ninval(0, (MKSUE(WCHAR_TYPE))->suesize, p);
  654+        } while (s[-1] != 0);
  655+        nfree(p);
  656+}
  657+
  658+
628659 static int inbits, inval;
 629660 
 630661 /*
     
 !
811842 
 812843 /* make a common declaration for id, if reasonable */
 813844 void
<>814 -commdec(struct symtab *q)
  845+defzero(struct symtab *sp)
815846 {
 816847         int off;
 817848 
<>818 -        off = tsize(q->stype, q->sdf, q->ssue);
  849+        off = tsize(sp->stype, sp->sdf, sp->ssue);
819850         off = (off+(SZCHAR-1))/SZCHAR;
<>820 -        printf("        .comm %s,0%o\n", exname(q->soname), off);
 821 -}
 822 -
 823 -/* make a local common declaration for id, if reasonable */
 824 -void
 825 -lcommdec(struct symtab *q)
 826 -{
 827 -        int off;
 828 -
 829 -        off = tsize(q->stype, q->sdf, q->ssue);
 830 -        off = (off+(SZCHAR-1))/SZCHAR;
 831 -        if (q->slevel == 0)
 832 -                printf("        .lcomm %s,0%o\n", exname(q->soname), off);
  851+        printf("        .%scomm ", sp->sclass == STATIC ? "l" : "");
  852+        if (sp->slevel == 0)
  853+                printf("%s,0%o\n", exname(sp->soname), off);
833854         else
<>834 -                printf("        .lcomm " LABFMT ",0%o\n", q->soffset, off);
  855+                printf(LABFMT ",0%o\n", sp->soffset, off);
835856 }
 836857 
<>837 -/*
 838 - * print a (non-prog) label.
 839 - */
 840 -void
 841 -deflab1(int label)
 842 -{
 843 -        printf(LABFMT ":\n", label);
 844 -}
 845 -
 846 -static char *loctbl[] = { "text", "data", "section .rodata", "section .rodata" };
 847 -
 848 -void
 849 -setloc1(int locc)
 850 -{
 851 -        if (lastloc == -3) {
 852 -                /* Ignore first printout after #pragma section */
 853 -                lastloc = -2;
 854 -                return;
 855 -        }
 856 -        if (locc == lastloc)
 857 -                return;
 858 -        lastloc = locc;
 859 -        printf("        .%s\n", loctbl[locc]);
 860 -}
 861 -
862858 static char *nextsect;
 863859 
 864860 #define SSECTION        010000
 865861 
<>866 -/*
 867 - * Give target the opportunity of handling pragmas.
  862+/* * Give target the opportunity of handling pragmas.
<_868863  */
 869864 int
 870865 mypragma(char **ary)
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 12:15 +0100