Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.17
 
1.18
 
MAIN:ragge:20100410094033
 
code.c
_>5353 #define VARSA(x)        (x-SZINT-SZINT-SZPOINT(0))
 5454 
 5555 int lastloc = -1;
<> 56+static int stroffset;
5657 
 5758 static int argtyp(TWORD t, union dimfun *df, struct suedef *sue);
 5859 static NODE *movtomem(NODE *p, int off, int reg);
<> 60+static NODE *movtoreg(NODE *p, int rno);
5961 
 6062 /*
 6163  * Define everything needed to print out some data (or text).
     
 !
6769         extern char *nextsect;
 6870         static char *loctbl[] = { "text", "data", "section .rodata" };
 6971         int weak = 0;
<>70 -        char *name = NULL;
  72+        char *name;
7173         TWORD t;
 7274         int s;
 7375 
     
 !
7779         }
 7880         t = sp->stype;
 7981         s = ISFTN(t) ? PROG : ISCON(cqual(t, sp->squal)) ? RDATA : DATA;
<> 82+        if ((name = sp->soname) == NULL)
  83+                name = exname(sp->sname);
8084 #ifdef TLS
 8185         if (sp->sflags & STLS) {
 8286                 if (s != DATA)
     
 !
9296                         nextsect = ga->a1.sarg;
 9397                 if ((ga = gcc_get_attr(sp->ssue, GCC_ATYP_WEAK)) != NULL)
 9498                         weak = 1;
<> 99+                if (gcc_get_attr(sp->ssue, GCC_ATYP_DESTRUCTOR)) {
  100+                        printf("\t.section\t.dtors,\"aw\",@progbits\n");
  101+                        printf("\t.align 8\n\t.quad\t%s\n", name);
  102+                        lastloc = -1;
  103+                }
  104+                if (gcc_get_attr(sp->ssue, GCC_ATYP_CONSTRUCTOR)) {
  105+                        printf("\t.section\t.ctors,\"aw\",@progbits\n");
  106+                        printf("\t.align 8\n\t.quad\t%s\n", name);
  107+                        lastloc = -1;
  108+                }
95109         }
 96110 #endif
 97111 
     
 !
107121         s = ISFTN(t) ? ALINT : talign(t, sp->ssue);
 108122         if (s > ALCHAR)
 109123                 printf("        .align %d\n", s/ALCHAR);
<>110 -        if (weak || sp->sclass == EXTDEF || sp->slevel == 0 || ISFTN(t))
 111 -                if ((name = sp->soname) == NULL)
 112 -                        name = exname(sp->sname);
113124         if (weak)
 114125                 printf("        .weak %s\n", name);
 115126         else if (sp->sclass == EXTDEF) {
     
 !
130141 void
 131142 efcode()
 132143 {
<> 144+        struct symtab *sp;
133145         extern int gotnr;
<>134 -        NODE *p, *q;
  146+        TWORD t;
  147+        NODE *p;
135148 
 136149         gotnr = 0;      /* new number for next fun */
<>137 -        if (cftnsp->stype != STRTY+FTN && cftnsp->stype != UNIONTY+FTN)
  150+        sp = cftnsp;
  151+        t = DECREF(sp->stype);
  152+        if (t != STRTY || t != UNIONTY)
138153                 return;
<> 154+        if (argtyp(t, sp->sdf, sp->ssue) != STRMEM)
  155+                return;
  156+
  157+        /* Move input value to rax */
  158+        p = tempnode(stroffset, INCREF(t), sp->sdf, sp->ssue);
  159+        ecomp(movtoreg(p, RAX));
  160+#if 0
139161         /* Create struct assignment */
 140162         q = block(OREG, NIL, NIL, PTR+STRTY, 0, cftnsp->ssue);
 141163         q->n_rval = RBP;
     
 !
145167         p = buildtree(UMUL, p, NIL);
 146168         p = buildtree(ASSIGN, q, p);
 147169         ecomp(p);
<> 170+#endif
148171 }
 149172 
 150173 /*
     
 !
165188         nrsp = ARGINIT;
 166189         if (cftnsp->stype == STRTY+FTN || cftnsp->stype == UNIONTY+FTN) {
 167190                 sp = cftnsp;
<>168 -                if (tsize(sp->stype, sp->sdf, sp->ssue) > SZLONG*2)
 169 -                        ngpr++; /* For hidden argument */
  191+                if (argtyp(DECREF(sp->stype), sp->sdf, sp->ssue) == STRMEM) {
  192+                        r = block(REG, NIL, NIL, LONG, 0, MKSUE(LONG));
  193+                        regno(r) = ngpr++;
  194+                        p = tempnode(0, r->n_type, r->n_df, r->n_sue);
  195+                        stroffset = regno(p);
  196+                        ecomp(buildtree(ASSIGN, p, r));
  197+                }
<_170198         }
 171199 
 172200         for (i = 0; i < cnt; i++) {
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-21 14:08 +0200