Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.1
 
1.2
 
MAIN:gmcgarry:20071105145703
 
code.c
_>7373  * code for the end of a function
 7474  * deals with struct return here
 7575  */
 7676 void
 7777 efcode()
 7878 {
<>79 -        NODE *p, *q;
 80 -        int sz;
 81 -
8279         if (cftnsp->stype != STRTY+FTN && cftnsp->stype != UNIONTY+FTN)
 8380                 return;
 8481 }
 8582 
 8683 /*
 8784  * helper for bfcode() to put register arguments on stack.
     
 !
114111 void
 115112 bfcode(struct symtab **a, int n)
 116113 {
 117114         int i, m;
 118115 
 119116         /* Passed arguments start 64 bits above the framepointer. */
<>120 -        passedargoff = 64;
  117+        passedargoff = ARGINIT;
121118         
 122119         if (cftnsp->stype == STRTY+FTN || cftnsp->stype == UNIONTY+FTN) {
 123120                 /* Function returns struct, adjust arg offset */
 124121                 for (i = 0; i < n; i++)
 125122                         a[i]->soffset += SZPOINT(INT);
 126123         }
     
 !
170167  * Print character t at position i in one string, until t == -1.
 171168  * Locctr & label is already defined.
 172169  */
 173170 void
 174171 bycode(int t, int i)
 175172 {
<>176 -        static  int     lastoctal = 0;
  173+        static int lastoctal = 0;
177174 
 178175         /* put byte i+1 in a string */
 179176 
 180177         if (t < 0) {
 181178                 if (i != 0)
 182179                         puts("\"");
 183180         } else {
 184181                 if (i == 0)
<>185 -                        printf("\t.ascii \"");
 186 -                if (t == '\\' || t == '"') {
  182+                        printf("\t.asciiz \"");
  183+                if (t == 0)
  184+                        return;
  185+                else if (t == '\\' || t == '"') {
187186                         lastoctal = 0;
 188187                         putchar('\\');
 189188                         putchar(t);
<> 189+                } else if (t == 012) {
  190+                        printf("\\n");
190191                 } else if (t < 040 || t >= 0177) {
 191192                         lastoctal++;
 192193                         printf("\\%o",t);
 193194                 } else if (lastoctal && '0' <= t && t <= '9') {
 194195                         lastoctal = 0;
<>195 -                        printf("\"\n\t.ascii \"%c", t);
  196+                        printf("\"\n\t.asciiz \"%c", t);
196197                 } else {        
 197198                         lastoctal = 0;
 198199                         putchar(t);
 199200                 }
 200201         }
 201202 }
     
 !
204205  * n integer words of zeros
 205206  */
 206207 void
 207208 zecode(int n)
 208209 {
 209210         printf("        .zero %d\n", n * (SZINT/SZCHAR));
<>210 -        inoff += n * SZINT;
  211+//      inoff += n * SZINT;
211212 }
 212213 
 213214 /*
 214215  * return the alignment of field of type t
 215216  */
 216217 int
     
 !
231232  * The first is >=0 if there is a default label;
 232233  * its value is the label number
 233234  * The entries p[1] to p[n] are the nontrivial cases
 234235  * XXX - fix genswitch.
 235236  */
 236237 void
<>237 -genswitch(struct swents **p, int n)
  238+genswitch(int num, struct swents **p, int n)
238239 {
<> 240+        NODE *r;
  241+        int i;
  242+
  243+        /* simple switch code */
  244+        for (i = 1; i <= n; ++i) {
  245+                /* already in 1 */
  246+                r = tempnode(num, INT, 0, MKSUE(INT));
  247+                r = buildtree(NE, r, bcon(p[i]->sval));
  248+                cbranch(buildtree(NOT, r, NIL), bcon(p[i]->slab));
  249+        }
  250+        if (p[0]->slab > 0)
  251+                branch(p[0]->slab);
<_239252 }
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-03 01:43 +0200