Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.9
 
1.10
 
MAIN:ragge:20140309093258
 
code.c
_>4040 }
 4141 
 4242 /*
<>43 - * define the current location as the name p->soname
 44 - * never called for text segment.
  43+ * Print out assembler segment name.
4544  */
 4645 void
<>47 -defnam(struct symtab *p)
  46+setseg(int seg, char *name)
4847 {
<>49 -        char *c = p->soname;
  48+        switch (seg) {
  49+        case PROG: name = ".text"; break;
  50+        case DATA:
  51+        case LDATA: name = ".data"; break;
  52+        case STRNG:
  53+        case RDATA: name = ".section .rodata"; break;
  54+        case UDATA: break;
  55+        default:
  56+                cerror((char *)__func__);
  57+        }
  58+        printf("\t%s\n", name);
  59+}
5060 
<>51 -        if (p->sclass == EXTDEF)
 52 -                printf("        .globl %s\n", c);
 53 -        printf("%s:\n", c);
  61+/*
  62+ * Define everything needed to print out some data (or text).
  63+ * This means segment, alignment, visibility, etc.
  64+ */
  65+void
  66+defloc(struct symtab *sp)
  67+{
  68+        char *name;
  69+
  70+        if ((name = sp->soname) == NULL)
  71+                name = exname(sp->sname);
  72+
  73+        if (sp->sclass == EXTDEF)
  74+                printf("\t.globl %s\n", name);
  75+        if (sp->slevel == 0)
  76+                printf("%s:\n", name);
  77+        else
  78+                printf(LABFMT ":\n", sp->soffset);
5479 }
 5580 
<> 81+/* make a common declaration for id, if reasonable */
  82+void
  83+defzero(struct symtab *sp)
  84+{
  85+        int off, al;
  86+        char *name;
5687 
<> 88+        if ((name = sp->soname) == NULL)
  89+                name = exname(sp->sname);
  90+        off = tsize(sp->stype, sp->sdf, sp->sap);
  91+        SETOFF(off,SZCHAR);
  92+        off /= SZCHAR;
  93+        al = talign(sp->stype, sp->sap)/SZCHAR;
  94+
  95+        if (sp->sclass == STATIC) {
  96+                if (sp->slevel == 0) {
  97+                        printf("\t.local %s\n", name);
  98+                } else
  99+                        printf("\t.local " LABFMT "\n", sp->soffset);
  100+        }
  101+        if (sp->slevel == 0) {
  102+                printf("\t.comm %s,0%o,%d\n", name, off, al);
  103+        } else
  104+                printf("\t.comm " LABFMT ",0%o,%d\n", sp->soffset, off, al);
  105+}
  106+
  107+
57108 /*
 58109  * code for the end of a function
 59110  * deals with struct return here
     
 !
62113 efcode(void)
 63114 {
 64115         NODE *p, *q;
<>65 -        int sz;
  116+//      int sz;
66117 
 67118         if (cftnsp->stype != STRTY+FTN && cftnsp->stype != UNIONTY+FTN)
 68119                 return;
     
 !
76127 //      q->n_rval = EBP;
 77128         q->n_lval = 8; /* return buffer offset */
 78129         p = block(CM, q, p, INT, 0, 0);
<>79 -        sz = (tsize(STRTY, cftnsp->sdf, cftnsp->ssue)+SZCHAR-1)/SZCHAR;
 80 -        p = block(CM, p, bcon(sz), INT, 0, 0);
  130+//      sz = (tsize(STRTY, cftnsp->sdf, cftnsp->ssue)+SZCHAR-1)/SZCHAR;
  131+//      p = block(CM, p, bcon(sz), INT, 0, 0);
81132         p->n_right->n_name = "";
 82133         p = block(CALL, bcon(0), p, CHAR+PTR, 0, 0);
 83134         p->n_left->n_name = "memcpy";
     
 !
115166 {
 116167 }
 117168 
<> 169+#if 0
118170 /*
 119171  * Print character t at position i in one string, until t == -1.
 120172  * Locctr & label is already defined.
     
 !
148200                 }
 149201         }
 150202 }
<> 203+#endif
151204 
 152205 /* fix up type of field p */
 153206 void
     
 !
172225 {
 173226         return p;
 174227 }
<_ 228+
  229+/*
  230+ * Return return as given by a.
  231+ */
  232+NODE *
  233+builtin_return_address(const struct bitable *bt, NODE *a)
  234+{
  235+        cerror((char *)__func__);
  236+        return 0;
  237+}
  238+
  239+/*
  240+ * Return frame as given by a.
  241+ */
  242+NODE *
  243+builtin_frame_address(const struct bitable *bt, NODE *a)
  244+{
  245+        cerror((char *)__func__);
  246+        return 0;
  247+}
  248+
  249+/*
  250+ * Return "canonical frame address".
  251+ */
  252+NODE *
  253+builtin_cfa(const struct bitable *bt, NODE *a)
  254+{
  255+        cerror((char *)__func__);
  256+        return 0;
  257+}
  258+
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-09-21 12:06 +0200