Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.10
 
1.11
 
MAIN:ragge:20110623134823
 
code.c
_>3535 
 3636 # include "pass1.h"
 3737 
<>38 -short log2tab[] = {0, 0, 1, 2, 2, 3, 3, 3, 3};
 39 -#define LOG2SZ 9
 40 -
  38+/*
  39+ * Print out assembler segment name.
  40+ */
4141 void
<>42 -defalign(n) {
 43 -        /* cause the alignment to become a multiple of n */
 44 -        n /= SZCHAR;
 45 -        if( lastloc != PROG && n > 1 ) printf( "        .align  %d\n", n >= 0 && n < LOG2SZ ? log2tab[n] : 0 );
  42+setseg(int seg, char *name)
  43+{
  44+        switch (seg) {
  45+        case PROG: name = ".text"; break;
  46+        case DATA:
  47+        case LDATA: name = ".data"; break;
  48+        case STRNG:
  49+        case RDATA: name = ".rodata"; break;
  50+        case UDATA: break;
  51+        case PICLDATA:
  52+        case PICDATA:
  53+        case PICRDATA:
  54+        case TLSDATA:
  55+        case TLSUDATA:
  56+        case CTORS:
  57+        case DTORS:
  58+                uerror("FIXME: unsupported segment");
  59+        case NMSEG:
  60+                printf("\t.section %s,\"aw\",@progbits\n", name);
  61+                return;
4662         }
<> 63+        printf("\t%s\n", name);
  64+}
4765 
 4866 /*
<>49 - * output something to define the current position as label n
  67+ * Define everything needed to print out some data (or text).
  68+ * This means segment, alignment, visibility, etc.
5069  */
 5170 void
<>52 -deflab1(int n)
  71+defloc(struct symtab *sp)
5372 {
<>54 -        printf(LABFMT ":\n", n);
  73+        char *name;
  74+
  75+        if ((name = sp->soname) == NULL)
  76+                name = exname(sp->sname);
  77+
  78+        if (sp->sclass == EXTDEF) {
  79+                printf("\t.globl %s\n", name);
  80+                printf("\t.type %s,@%s\n", name,
  81+                    ISFTN(sp->stype)? "function" : "object");
  82+        }
  83+        if (sp->slevel == 0)
  84+                printf("%s:\n", name);
  85+        else
  86+                printf(LABFMT ":\n", sp->soffset);
5587 }
 5688 
<> 89+
  90+
<_5791 void
 5892 efcode(){
 5993         /* code for the end of a function */
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-11 00:53 +0200