Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.5
 
1.6
 
MAIN:ragge:20090522121959
 
code.c
_>4444 {
 4545         extern char *nextsect;
 4646         static char *loctbl[] = { "text", "data", "section .rodata" };
<> 47+        int weak = 0;
  48+        char *name = NULL;
4749         TWORD t;
 4850         int s;
 4951 
     
 !
6062                 nextsect = ".tdata";
 6163         }
 6264 #endif
<> 65+#ifdef GCC_COMPAT
  66+        {
  67+                struct gcc_attrib *ga;
  68+
  69+                if ((ga = gcc_get_attr(sp->ssue, GCC_ATYP_SECTION)) != NULL)
  70+                        nextsect = ga->a1.sarg;
  71+                if ((ga = gcc_get_attr(sp->ssue, GCC_ATYP_WEAK)) != NULL)
  72+                        weak = 1;
  73+        }
  74+#endif
  75+
6376         if (nextsect) {
 6477                 printf("        .section %s\n", nextsect);
 6578                 nextsect = NULL;
     
 !
7285         s = ISFTN(t) ? ALINT : talign(t, sp->ssue);
 7386         if (s > ALCHAR)
 7487                 printf("        .align %d\n", s/ALCHAR);
<>75 -        if (sp->sclass == EXTDEF)
 76 -                printf("        .globl %s\n", exname(sp->soname));
  88+        if (weak || sp->sclass == EXTDEF || sp->slevel == 0 || ISFTN(t))
  89+                if ((name = sp->soname) == NULL)
  90+                        name = exname(sp->sname);
  91+        if (weak)
  92+                printf("        .weak %s\n", name);
  93+        else if (sp->sclass == EXTDEF)
  94+                printf("        .globl %s\n", name);
7795         if (ISFTN(t))
<>78 -                printf("\t.type %s,@function\n", exname(sp->soname));
  96+                printf("\t.type %s,@function\n", name);
7997         if (sp->slevel == 0)
<>80 -                printf("%s:\n", exname(sp->soname));
  98+                printf("%s:\n", name);
8199         else
 82100                 printf(LABFMT ":\n", sp->soffset);
 83101 }
 84102 
<> 103+#if 0
85104 /*
<> 105+ * AMD64 parameter classification.
  106+ */
  107+classify(NODE *p)
  108+{
  109+        TWORD t = p->n_type;
  110+        int cl = 0;
  111+
  112+        if (t <= ULONGLONG) {
  113+                cl = INTEGER;
  114+        } else if (t == FLOAT || t == DOUBLE) {
  115+                cl = SSE;
  116+        } else if (t == LDOUBLE) {
  117+                cl = LDB;
  118+        } else if (t == STRTY) {
  119+                if (tsize(t, p->n_df, p->n_sue) > 4*SZLONG)
  120+                        cl = MEM;
  121+                else
  122+                        cerror("clasif");
  123+        } else
  124+                cerror("FIXME: classify");
  125+        return cl;
  126+}
  127+#endif
  128+
  129+/*
86130  * code for the end of a function
 87131  * deals with struct return here
 88132  */
     
 !
218262         }
 219263 
 220264         if (*n >= 6) {
<>221 -                *n++;
  265+                (*n)++;
222266                 r = block(OREG, NIL, NIL, p->n_type|PTR, 0,
 223267                     MKSUE(p->n_type|PTR));
 224268                 r->n_rval = RBP;
     
 !
248292 
 249293         p->n_right = funarg(p->n_right, &n);
 250294 
<> 295+        /* clear al at the end if varargs.  Do it always for now. */
  296+        l = block(REG, NIL, NIL, INT, 0, MKSUE(INT));
  297+        l->n_rval = RAX;
  298+        l = buildtree(ASSIGN, l, bcon(0));
  299+        if (p->n_right->n_op != CM) {
  300+                p->n_right = block(CM, l, p->n_right, INT, 0, MKSUE(INT));
  301+        } else {
  302+                for (r = p->n_right; r->n_left->n_op == CM; r = r->n_left)
  303+                        ;
  304+                r->n_left = block(CM, l, r->n_left, INT, 0, MKSUE(INT));
  305+        }
  306+
<_251307         if (kflag == 0)
 252308                 return p;
 253309         /* Create an ASSIGN node for ebx */
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-02 16:29 +0200