Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.47
 
1.48
 
MAIN:ragge:20110121214939
 
code.c
_>6565 static int argtyp(TWORD t, union dimfun *df, struct attr *ap);
 6666 static NODE *movtomem(NODE *p, int off, int reg);
 6767 static NODE *movtoreg(NODE *p, int rno);
<> 68+void varattrib(char *name, struct attr *sap);
6869 
 6970 /*
 7071  * Define everything needed to print out some data (or text).
     
 !
7677         extern char *nextsect;
 7778         static char *loctbl[] = { "text", "data", "section .rodata" };
 7879         extern int tbss;
<>79 -        int weak = 0;
8080         char *name;
 8181         TWORD t;
 8282         int s;
     
 !
110110                 lastloc = -1;
 111111         }
 112112 
<>113 -#ifdef GCC_COMPAT
 114 -        {
 115 -                struct attr *ga;
  113+        varattrib(name, sp->sap);
116114 
<>117 -                if ((ga = attr_find(sp->sap, GCC_ATYP_SECTION)) != NULL)
 118 -                        nextsect = ga->sarg(0);
 119 -                if ((ga = attr_find(sp->sap, GCC_ATYP_WEAK)) != NULL)
 120 -                        weak = 1;
 121 -                if (attr_find(sp->sap, GCC_ATYP_DESTRUCTOR)) {
 122 -                        printf("\t.section\t.dtors,\"aw\",@progbits\n");
 123 -                        printf("\t.align 8\n\t.quad\t%s\n", name);
 124 -                        lastloc = -1;
 125 -                }
 126 -                if (attr_find(sp->sap, GCC_ATYP_CONSTRUCTOR)) {
 127 -                        printf("\t.section\t.ctors,\"aw\",@progbits\n");
 128 -                        printf("\t.align 8\n\t.quad\t%s\n", name);
 129 -                        lastloc = -1;
 130 -                }
 131 -                if ((ga = attr_find(sp->sap, GCC_ATYP_VISIBILITY)) &&
 132 -                    strcmp(ga->sarg(0), "default"))
 133 -                        printf("\t.%s %s\n", ga->sarg(0), name);
 134 -        }
 135 -#endif
 136 -
137115         if (nextsect) {
 138116                 printf("        .section %s\n", nextsect);
 139117                 nextsect = NULL;
     
 !
146124         s = ISFTN(t) ? ALINT : talign(t, sp->sap);
 147125         if (s > ALCHAR)
 148126                 printf("        .align %d\n", s/ALCHAR);
<>149 -        if (weak)
 150 -                printf("        .weak %s\n", name);
 151 -        else if (sp->sclass == EXTDEF) {
  127+        if (sp->sclass == EXTDEF) {
152128                 printf("\t.globl %s\n", name);
 153129 #ifndef MACHOABI
 154130                 printf("\t.type %s,@%s\n", name,
     
 !
162138 }
 163139 
 164140 /*
<> 141+ * Print out variable attributes.
  142+ */
  143+void
  144+varattrib(char *name, struct attr *sap)
  145+{
  146+        extern char *nextsect;
  147+        struct attr *ga;
  148+
  149+        if ((ga = attr_find(sap, GCC_ATYP_SECTION)) != NULL)
  150+                nextsect = ga->sarg(0);
  151+        if ((ga = attr_find(sap, GCC_ATYP_WEAK)) != NULL)
  152+                printf("        .weak %s\n", name);
  153+        if (attr_find(sap, GCC_ATYP_DESTRUCTOR)) {
  154+                printf("\t.section\t.dtors,\"aw\",@progbits\n");
  155+                printf("\t.align 8\n\t.quad\t%s\n", name);
  156+                lastloc = -1;
  157+        }
  158+        if (attr_find(sap, GCC_ATYP_CONSTRUCTOR)) {
  159+                printf("\t.section\t.ctors,\"aw\",@progbits\n");
  160+                printf("\t.align 8\n\t.quad\t%s\n", name);
  161+                lastloc = -1;
  162+        }
  163+        if ((ga = attr_find(sap, GCC_ATYP_VISIBILITY)) &&
  164+            strcmp(ga->sarg(0), "default"))
  165+                printf("\t.%s %s\n", ga->sarg(0), name);
  166+        if ((ga = attr_find(sap, GCC_ATYP_ALIASWEAK))) {
  167+                printf("        .weak %s\n", ga->sarg(0));
  168+                printf("        .set %s,%s\n", ga->sarg(0), name);
  169+        }
  170+}
  171+
  172+/*
<_165173  * code for the end of a function
 166174  * deals with struct return here
 167175  * The return value is in (or pointed to by) RETREG.
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-07-10 07:06 +0200