Quick Search:

Mode

Context

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

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.1
 
1.2
 
MAIN:ragge:20071026150641
 
local.c
_>1313  * documentation and/or other materials provided with the distribution.
 1414  * All advertising materials mentioning features or use of this software
 1515  * must display the following acknowledgement:
<>16 - *      This product includes software developed or owned by Caldera
  16+ *      This product includes software developed or owned by Caldera
1717  *      International, Inc.
 1818  * Neither the name of Caldera International, Inc. nor the names of other
 1919  * contributors may be used to endorse or promote products derived from
     
 !
2323  * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
 2424  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 2525  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<>26 - * DISCLAIMED.  IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE
  26+ * DISCLAIMED.  IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE
2727  * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 2828  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 2929  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     
 !
3333  * POSSIBILITY OF SUCH DAMAGE.
 3434  */
 3535 
<>36 -# include "mfile1"
  36+# include "pass1.h"
3737 
 3838 /*      this file contains code which is dependent on the target machine */
 3939 
<> 40+#if 0
4041 NODE *
 4142 cast( p, t ) register NODE *p; TWORD t; {
 4243         /* cast node p to type t */
     
 !
4647         p->op = FREE;
 4748         return( p->right );
 4849         }
<> 50+#endif
4951 
 5052 NODE *
 5153 clocal(p) NODE *p; {
     
 !
6466 
 6567         register struct symtab *q;
 6668         register NODE *r;
<>67 -        register o;
 68 -        register m, ml;
  69+        register int o;
  70+        register int m, ml;
6971 
<>70 -        switch( o = p->op ){
  72+        switch( o = p->n_op ){
7173 
 7274         case NAME:
<>73 -                if( p->rval < 0 ) { /* already processed; ignore... */
  75+                if((q = p->n_sp) == 0 ) { /* already processed; ignore... */
7476                         return(p);
 7577                         }
<>76 -                q = &stab[p->rval];
7778                 switch( q->sclass ){
 7879 
 7980                 case AUTO:
 8081                 case PARAM:
 8182                         /* fake up a structure reference */
 8283                         r = block( REG, NIL, NIL, PTR+STRTY, 0, 0 );
<>83 -                        r->lval = 0;
 84 -                        r->rval = (q->sclass==AUTO?STKREG:ARGREG);
  84+                        r->n_lval = 0;
  85+                        r->n_rval = (q->sclass==AUTO?STKREG:ARGREG);
8586                         p = stref( block( STREF, r, p, 0, 0, 0 ) );
 8687                         break;
 8788 
<>88 -                case ULABEL:
 89 -                case LABEL:
9089                 case STATIC:
 9190                         if( q->slevel == 0 ) break;
<>92 -                        p->lval = 0;
 93 -                        p->rval = -q->offset;
  91+                        p->n_lval = 0;
  92+                        p->n_rval = -q->soffset;
9493                         break;
 9594 
 9695                 case REGISTER:
<>97 -                        p->op = REG;
 98 -                        p->lval = 0;
 99 -                        p->rval = q->offset;
  96+                        p->n_op = REG;
  97+                        p->n_lval = 0;
  98+                        p->n_rval = q->soffset;
10099                         break;
 101100 
 102101                         }
 103102                 break;
 104103 
 105104         case PCONV:
 106105                 /* do pointer conversions for char and longs */
<>107 -                ml = p->left->type;
 108 -                if( ( ml==CHAR || ml==UCHAR || ml==SHORT || ml==USHORT ) && p->left->op != ICON ) break;
  106+                ml = p->n_left->n_type;
  107+                if( ( ml==CHAR || ml==UCHAR || ml==SHORT || ml==USHORT ) && p->n_left->n_op != ICON ) break;
109108 
 110109                 /* pointers all have the same representation; the type is inherited */
 111110 
 112111         inherit:
<>113 -                p->left->type = p->type;
 114 -                p->left->cdim = p->cdim;
 115 -                p->left->csiz = p->csiz;
 116 -                p->op = FREE;
 117 -                return( p->left );
  112+                p->n_left->n_type = p->n_type;
  113+                p->n_left->n_df = p->n_df;
  114+                p->n_left->n_sue = p->n_sue;
  115+                r = p->n_left;
  116+                nfree(p);
  117+                return( r );
118118 
 119119         case SCONV:
<>120 -                m = (p->type == FLOAT || p->type == DOUBLE );
 121 -                ml = (p->left->type == FLOAT || p->left->type == DOUBLE );
  120+                m = (p->n_type == FLOAT || p->n_type == DOUBLE );
  121+                ml = (p->n_left->n_type == FLOAT || p->n_left->n_type == DOUBLE );
122122                 if( m != ml ) break;
 123123 
 124124                 /* now, look for conversions downwards */
 125125 
<>126 -                m = p->type;
 127 -                ml = p->left->type;
 128 -                if( p->left->op == ICON ){ /* simulate the conversion here */
  126+                m = p->n_type;
  127+                ml = p->n_left->n_type;
  128+                if( p->n_left->n_op == ICON ){ /* simulate the conversion here */
129129                         CONSZ val;
<>130 -                        val = p->left->lval;
  130+                        val = p->n_left->n_lval;
131131                         switch( m ){
 132132                         case CHAR:
<>133 -                                p->left->lval = (char) val;
  133+                                p->n_left->n_lval = (char) val;
134134                                 break;
 135135                         case UCHAR:
<>136 -                                p->left->lval = val & 0XFF;
  136+                                p->n_left->n_lval = val & 0XFF;
137137                                 break;
 138138                         case USHORT:
<>139 -                                p->left->lval = val & 0XFFFFL;
  139+                                p->n_left->n_lval = val & 0XFFFFL;
140140                                 break;
 141141                         case SHORT:
<>142 -                                p->left->lval = (short)val;
  142+                                p->n_left->n_lval = (short)val;
143143                                 break;
 144144                         case UNSIGNED:
<>145 -                                p->left->lval = val & 0xFFFFFFFFL;
  145+                                p->n_left->n_lval = val & 0xFFFFFFFFL;
146146                                 break;
 147147                         case INT:
<>148 -                                p->left->lval = (int)val;
  148+                                p->n_left->n_lval = (int)val;
149149                                 break;
 150150                                 }
<>151 -                        p->left->type = m;
  151+                        p->n_left->n_type = m;
152152                         }
 153153                 else {
 154154                         /* meaningful ones are conversion of int to char, int to short,
     
 !
162162                         }
 163163 
 164164                 /* clobber conversion */
<>165 -                if( tlen(p) == tlen(p->left) ) goto inherit;
 166 -                p->op = FREE;
 167 -                return( p->left );  /* conversion gets clobbered */
  165+                if( tlen(p) == tlen(p->n_left) ) goto inherit;
  166+                r = p->n_left;
  167+                nfree(p);
  168+                return( r );  /* conversion gets clobbered */
168169 
 169170         case PVCONV:
 170171         case PMCONV:
<>171 -                if( p->right->op != ICON ) cerror( "bad conversion", 0);
 172 -                p->op = FREE;
 173 -                return( buildtree( o==PMCONV?MUL:DIV, p->left, p->right ) );
  172+                if( p->n_right->n_op != ICON ) cerror( "bad conversion", 0);
  173+                r = buildtree( o==PMCONV?MUL:DIV, p->n_left, p->n_right);
  174+                nfree(p);
  175+                return r;
174176 
 175177         case RS:
<>176 -        case ASG RS:
  178+        case RSEQ:
177179                 /* convert >> to << with negative shift count */
 178180                 /* only if type of left operand is not unsigned */
<>179 -                if( ISUNSIGNED(p->left->type) ) break;
 180 -                p->right = buildtree( UNARY MINUS, p->right, NIL );
 181 -                if( p->op == RS ) p->op = LS;
 182 -                else p->op = ASG LS;
  181+                if( ISUNSIGNED(p->n_left->n_type) ) break;
  182+                p->n_right = buildtree( UMINUS, p->n_right, NIL );
  183+                if( p->n_op == RS ) p->n_op = LS;
  184+                else p->n_op = LSEQ;
183185                 break;
 184186 
<> 187+        case FORCE:
  188+                p->n_op = ASSIGN;
  189+                p->n_right = p->n_left;
  190+                p->n_left = block(REG, NIL, NIL, p->n_type, 0, MKSUE(INT));
  191+                p->n_left->n_rval = p->n_left->n_type == BOOL ?
  192+                    RETREG(CHAR) : RETREG(p->n_type);
  193+                break;
  194+
  195+        case STCALL:
  196+        case CALL:
  197+                /* Fix function call arguments. On vax, just add funarg */
  198+                for (r = p->n_right; r->n_op == CM; r = r->n_left) {
  199+                        if (r->n_right->n_op != STARG &&
  200+                            r->n_right->n_op != FUNARG)
  201+                                r->n_right = block(FUNARG, r->n_right, NIL,
  202+                                    r->n_right->n_type, r->n_right->n_df,
  203+                                    r->n_right->n_sue);
185204                 }
<> 205+                if (r->n_op != STARG && r->n_op != FUNARG) {
  206+                        NODE *l = talloc();
  207+                        *l = *r;
  208+                        r->n_op = FUNARG; r->n_left = l; r->n_type = l->n_type;
  209+                }
  210+                break;
  211+        }
186212 
 187213         return(p);
<>188 -        }
  214+}
189215 
<> 216+int
190217 andable( p ) NODE *p; {
 191218         return(1);  /* all names can have & taken on them */
 192219         }
<>193 -
  220+ 
  221+void
194222 cendarg(){ /* at the end of the arguments of a ftn, set the automatic offset */
 195223         autooff = AUTOINIT;
 196224         }
 197225 
<> 226+int
198227 cisreg( t ) TWORD t; { /* is an automatic variable of type t OK for a register variable */
<>199 -
 200 -        if( t==INT || t==UNSIGNED || t==LONG || t==ULONG        /* tbl */
 201 -                || t==CHAR || t==UCHAR || t==SHORT || t==USHORT /* tbl */
 202 -                || ISPTR(t)) return(1);                 /* tbl */
 203 -        return(0);
  228+        return(1);      /* all are now */
204229         }
 205230 
 206231 NODE *
<>207 -offcon( off, t, d, s ) OFFSZ off; TWORD t; {
  232+offcon(OFFSZ off, TWORD t, union dimfun *d, struct suedef *sue)
  233+{
208234 
 209235         /* return a node, for structure references, which is suitable for
 210236            being added to a pointer of type t, in order to be off bits offset
     
 !
216242         /* in general they  are necessary for offcon, but not on H'well */
 217243 
 218244         p = bcon(0);
<>219 -        p->lval = off/SZCHAR;
  245+        p->n_lval = off/SZCHAR;
220246         return(p);
 221247 
 222248         }
 223249 
<> 250+void
  251+spalloc(NODE *t, NODE *p, OFFSZ off)
  252+{
  253+        cerror("spalloc");
  254+}
224255 
<>225 -incode( p, sz ) register NODE *p; {
  256+static int inbits, inval;
226257 
<>227 -        /* generate initialization code for assigning a constant c
 228 -                to a field of width sz */
 229 -        /* we assume that the proper alignment has been obtained */
 230 -        /* inoff is updated to have the proper final value */
 231 -        /* we also assume sz  < SZINT */
  258+/*
  259+ * set fsz bits in sequence to zero.
  260+ */
  261+void
  262+zbits(OFFSZ off, int fsz)
  263+{
  264+        int m;
232265 
<>233 -        inoff += sz;
 234 -        if (sz>SZSHORT)
 235 -                printf("        .long   %d:%d\n", sz, p->lval);
 236 -        else if (sz>SZCHAR)
 237 -                printf("        .word   %d:%d\n", sz, p->lval);
 238 -        else
 239 -                printf("        .byte   %d:%d\n", sz, p->lval);
  266+        if (idebug)
  267+                printf("zbits off %lld, fsz %d inbits %d\n", off, fsz, inbits);
  268+        if ((m = (inbits % SZCHAR))) {
  269+                m = SZCHAR - m;
  270+                if (fsz < m) {
  271+                        inbits += fsz;
  272+                        return;
  273+                } else {
  274+                        fsz -= m;
  275+                        printf("\t.byte %d\n", inval);
  276+                        inval = inbits = 0;
  277+                }
240278         }
<>241 -
 242 -fincode( d, sz ) double d; {
 243 -        /* output code to initialize space of size sz to the value d */
 244 -        /* the proper alignment has been obtained */
 245 -        /* inoff is updated to have the proper final value */
 246 -        /* on the target machine, write it out in octal! */
 247 -
 248 -
 249 -        printf("        %s      0%c%.20e\n", sz == SZDOUBLE ? ".double" : ".float",
 250 -                sz == SZDOUBLE ? 'd' : 'f', d);
 251 -        inoff += sz;
  279+        if (fsz >= SZCHAR) {
  280+                printf("\t.space %d\n", fsz/SZCHAR);
  281+                fsz -= (fsz/SZCHAR) * SZCHAR;
252282         }
<>253 -
 254 -cinit( p, sz ) NODE *p; {
 255 -        /* arrange for the initialization of p into a space of
 256 -        size sz */
 257 -        /* the proper alignment has been opbtained */
 258 -        /* inoff is updated to have the proper final value */
 259 -        ecode( p );
 260 -        inoff += sz;
  283+        if (fsz) {
  284+                inval = 0;
  285+                inbits = fsz;
261286         }
<> 287+}
262288 
<>263 -vfdzero( n ){ /* define n bits of zeros in a vfd */
 264 -        register i;
 265 -
 266 -        if( n <= 0 ) return;
 267 -
 268 -        inoff += n;
 269 -        i = n;
 270 -        while (i>=SZCHAR) {
 271 -                printf("        .byte   0\n");
 272 -                i -= SZCHAR;
  289+/*
  290+ * Initialize a bitfield.
  291+ */
  292+void
  293+infld(CONSZ off, int fsz, CONSZ val)
  294+{
  295+        if (idebug)
  296+                printf("infld off %lld, fsz %d, val %lld inbits %d\n",
  297+                    off, fsz, val, inbits);
  298+        val &= ((CONSZ)1 << fsz)-1;
  299+        while (fsz + inbits >= SZCHAR) {
  300+                inval |= (val << inbits);
  301+                printf("\t.byte %d\n", inval & 255);
  302+                fsz -= (SZCHAR - inbits);
  303+                val >>= (SZCHAR - inbits);
  304+                inval = inbits = 0;
273305         }
<>274 -        if (i) printf(" .byte   %d:0\n", i);
  306+        if (fsz) {
  307+                inval |= (val << inbits);
  308+                inbits += fsz;
275309         }
<> 310+}
276311 
 277312 
 278313 char *
 279314 exname( p ) char *p; {
 280315         /* make a name look like an external name in the local machine */
<>281 -
 282 -        static char text[NCHNAM+1];
 283 -
 284 -        register i;
 285 -
 286 -        text[0] = '_';
 287 -        for( i=1; *p&&i<NCHNAM; ++i ){
 288 -                text[i] = *p++;
 289 -                }
 290 -
 291 -        text[i] = '\0';
 292 -        text[NCHNAM] = '\0'/* truncate */
 293 -
 294 -        return( text );
  316+        /* vad is elf now */
  317+        if (p == NULL)
  318+                return "";
  319+        return( p );
295320         }
 296321 
<>297 -ctype( type ){ /* map types which are not defined on the local machine */
  322+TWORD
  323+ctype(TWORD type ){ /* map types which are not defined on the local machine */
298324         switch( BTYPE(type) ){
 299325 
 300326         case LONG:
     
 !
303329 
 304330         case ULONG:
 305331                 MODTYPE(type,UNSIGNED);
<> 332+                break;
  333+
  334+        case LDOUBLE:   /* for now */
  335+                MODTYPE(type,DOUBLE);
306336                 }
 307337         return( type );
 308338         }
 309339 
<>310 -noinit( t ) { /* curid is a variable which is defined but
 311 -        is not initialized (and not a function );
 312 -        This routine returns the stroage class for an uninitialized declaration */
  340+void
  341+calldec(NODE *p, NODE *q)
  342+{
  343+}
313344 
<>314 -        return(EXTERN);
  345+void
  346+extdec(struct symtab *q)
  347+{
  348+}
315349 
<>316 -        }
  350+void
  351+commdec( struct symtab *q ){ /* make a common declaration for id, if reasonable */
  352+        OFFSZ off;
317353 
<>318 -commdec( id ){ /* make a common declaration for id, if reasonable */
 319 -        register struct symtab *q;
 320 -        OFFSZ off, tsize();
 321 -
 322 -        q = &stab[id];
323354         printf( "       .comm   %s,", exname( q->sname ) );
<>324 -        off = tsize( q->stype, q->dimoff, q->sizoff );
  355+        off = tsize( q->stype, q->sdf, q->ssue );
325356         printf( CONFMT, off/SZCHAR );
 326357         printf( "\n" );
 327358         }
 328359 
<>329 -isitlong( cb, ce ){ /* is lastcon to be long or short */
 330 -        /* cb is the first character of the representation, ce the last */
  360+/* make a local common declaration for id, if reasonable */
  361+void
  362+lcommdec(struct symtab *q)
  363+{
  364+        int off;
331365 
<>332 -        if( ce == 'l' || ce == 'L' ||
 333 -                lastcon >= (1L << (SZINT-1) ) ) return (1);
 334 -        return(0);
 335 -        }
  366+        off = tsize(q->stype, q->sdf, q->ssue);
  367+        off = (off+(SZCHAR-1))/SZCHAR;
  368+        if (q->slevel == 0)
  369+#ifdef GCC_COMPAT
  370+                printf("        .lcomm %s,0%o\n", gcc_findname(q), off);
  371+#else
  372+                printf("        .lcomm %s,0%o\n", exname(q->sname), off);
  373+#endif
  374+        else
  375+                printf("        .lcomm " LABFMT ",0%o\n", q->soffset, off);
  376+}
336377 
 337378 
<>338 -isitfloat( s ) char *s; {
 339 -        double atof();
 340 -        dcon = atof(s);
 341 -        return( FCON );
 342 -        }
  379+static char *loctbl[] = { "text", "data", "section .rodata", "section .rodata" };
343380 
<>344 -ecode( p ) NODE *p; {
 345 -
 346 -        /* walk the tree and write out the nodes.. */
 347 -
 348 -        if( nerrors ) return;
 349 -        p2tree( p );
 350 -        p2compile( p );
 351 -        }
 352 -        
 353 -#include "a.out.h"
 354 -int ddebug;
 355 -int gdebug;
 356 -
 357 -
 358 -outstab(p)
 359 -struct symtab *p; {
 360 -        register TWORD ptype;
 361 -        register char *pname;
 362 -        register char pclass;
 363 -        register int poffset;
 364 -
 365 -        if (!gdebug) return;
 366 -
 367 -        ptype = p->stype;
 368 -        pname = p->sname;
 369 -        pclass = p->sclass;
 370 -        poffset = p->offset;
 371 -
 372 -        if (ISFTN(ptype)) {
  381+void
  382+setloc1(int locc)
  383+{
  384+        if (locc == lastloc)
373385                 return;
<>374 -        }
 375 -        
 376 -        switch (pclass) {
 377 -        
 378 -        case AUTO:
 379 -                pstab(pname, N_LSYM);
 380 -                printf("0,%d,%d\n", ptype, (-poffset)/SZCHAR);
 381 -                poffs(p);
 382 -                return;
 383 -        
 384 -        case EXTDEF:
 385 -        case EXTERN:
 386 -                pstab(pname, N_GSYM);
 387 -                printf("0,%d,0\n", ptype);
 388 -                poffs(p);
 389 -                return;
 390 -                        
 391 -        case STATIC:
 392 -                pstab(pname, N_STSYM);
 393 -                if (p->slevel > 1) {
 394 -                        printf("0,%d,L%d\n", ptype, poffset);
 395 -                } else {
 396 -                        printf("0,%d,%s\n", ptype, exname(pname));
 397 -                }
 398 -                poffs(p);
 399 -                return;
 400 -        
 401 -        case REGISTER:
 402 -                pstab(pname, N_RSYM);
 403 -                printf("0,%d,%d\n", ptype, poffset);
 404 -                poffs(p);
 405 -                return;
 406 -        
 407 -        case MOS:
 408 -        case MOU:
 409 -                pstab(pname, N_SSYM);
 410 -                printf("0,%d,%d\n", ptype, poffset/SZCHAR);
 411 -                poffs(p);
 412 -                return;
 413 -        
 414 -        case PARAM:
 415 -                /* parameter stab entries are processed in dclargs() */
 416 -                return;
 417 -        
 418 -        default:
 419 -                if (ddebug) printf("    No .stab for %.8s\n", pname);
 420 -        }
  386+        lastloc = locc;
  387+        printf("        .%s\n", loctbl[locc]);
421388 }
 422389 
<>423 -pstab(name, type)
 424 -char *name;
 425 -int type; {
 426 -        register int i;
 427 -        register char c;
 428 -        if (!gdebug) return;
 429 -        printf("        .stab   ");
 430 -        for(i=0; i<8; i++)
 431 -                if (c = name[i]) printf("'%c,", c);
 432 -                else printf("0,");
 433 -        printf("0%o,", type);
 434 -}
  390+/*
  391+ * print out a constant node, may be associated with a label.
  392+ * Do not free the node after use.
  393+ * off is bit offset from the beginning of the aggregate
  394+ * fsz is the number of bits this is referring to
  395+ * XXX - floating point constants may be wrong if cross-compiling.
  396+ */
  397+void
  398+ninval(CONSZ off, int fsz, NODE *p)
  399+{
  400+        union { float f; double d; long double l; int i[3]; } u;
  401+        struct symtab *q;
  402+        TWORD t;
435403 
<>436 -poffs(p)
 437 -register struct symtab *p; {
 438 -        int s;
 439 -        if (!gdebug) return;
 440 -        if ((s = dimtab[p->sizoff]/SZCHAR) > 1) {
 441 -                pstab(p->sname, N_LENG);
 442 -                printf("1,0,%d\n", s);
 443 -        }
 444 -}
  404+        t = p->n_type;
  405+        if (t > BTMASK)
  406+                t = INT; /* pointer */
445407 
<>446 -char NULLNAME[8];
 447 -int  labelno;
 448 -int  fdefflag;
  408+        if (p->n_op != ICON && p->n_op != FCON)
  409+                cerror("ninval: init node not constant");
449410 
<>450 -psline() {
 451 -        static int lastlineno;
 452 -        register char *cp, *cq;
 453 -        register int i;
 454 -        
 455 -        if (!gdebug) return;
  411+        if (p->n_op == ICON && p->n_sp != NULL && DEUNSIGN(t) != INT)
  412+                uerror("element not constant");
456413 
<>457 -        cq = ititle;
 458 -        cp = ftitle;
 459 -
 460 -        while ( *cq ) if ( *cp++ != *cq++ ) goto neq;
 461 -        if ( *cp == '\0' ) goto eq;
 462 -        
 463 -neq:    for (i=0; i<100; i++)
 464 -                ititle[i] = '\0';
 465 -        cp = ftitle;
 466 -        cq = ititle;
 467 -        while ( *cp
 468 -                *cq++ = *cp++;
 469 -        *cq = '\0';
 470 -        *--cq = '\0';
 471 -        for ( cp = ititle+1; *(cp-1); cp += 8 ) {
 472 -                pstab(cp, N_SOL);
 473 -                if (gdebug) printf("0,0,LL%d\n", labelno);
  414+        switch (t) {
  415+        case LONGLONG:
  416+        case ULONGLONG:
  417+                printf("\t.long 0x%x", (int)p->n_lval);
  418+                printf("\t.long 0x%x", (int)(p->n_lval >> 32));
  419+                break;
  420+        case INT:
  421+        case UNSIGNED:
  422+                printf("\t.long 0x%x", (int)p->n_lval);
  423+                if ((q = p->n_sp) != NULL) {
  424+                        if ((q->sclass == STATIC && q->slevel > 0) ||
  425+                            q->sclass == ILABEL) {
  426+                                printf("+" LABFMT, q->soffset);
  427+                        } else
  428+                                printf("+%s", exname(q->sname));
474429                 }
<>475 -        *cq = '"';
 476 -        printf("LL%d:\n", labelno++);
 477 -
 478 -eq:     if (lineno == lastlineno) return;
 479 -        lastlineno = lineno;
 480 -
 481 -        if (fdefflag) {
 482 -                pstab(NULLNAME, N_SLINE);
 483 -                printf("0,%d,LL%d\n", lineno, labelno);
 484 -                printf("LL%d:\n", labelno++);
 485 -                }
  430+                printf("\n");
  431+                break;
  432+        case SHORT:
  433+        case USHORT:
  434+                printf("\t.short 0x%x\n", (int)p->n_lval & 0xffff);
  435+                break;
  436+        case BOOL:
  437+                if (p->n_lval > 1)
  438+                        p->n_lval = p->n_lval != 0;
  439+                /* FALLTHROUGH */
  440+        case CHAR:
  441+        case UCHAR:
  442+                printf("\t.byte %d\n", (int)p->n_lval & 0xff);
  443+                break;
  444+        case LDOUBLE:
  445+                u.i[2] = 0;
  446+                u.l = (long double)p->n_dcon;
  447+                printf("\t.long\t0x%x,0x%x,0x%x\n", u.i[0], u.i[1], u.i[2]);
  448+                break;
  449+        case DOUBLE:
  450+                u.d = (double)p->n_dcon;
  451+                printf("\t.long\t0x%x,0x%x\n", u.i[0], u.i[1]);
  452+                break;
  453+        case FLOAT:
  454+                u.f = (float)p->n_dcon;
  455+                printf("\t.long\t0x%x\n", u.i[0]);
  456+                break;
  457+        default:
  458+                cerror("ninval");
486459         }
<>487 -        
 488 -plcstab(level) {
 489 -        if (!gdebug) return;
 490 -        pstab(NULLNAME, N_LBRAC);
 491 -        printf("0,%d,LL%d\n", level, labelno);
 492 -        printf("LL%d:\n", labelno++);
 493 -        }
 494 -        
 495 -prcstab(level) {
 496 -        if (!gdebug) return;
 497 -        pstab(NULLNAME, N_RBRAC);
 498 -        printf("0,%d,LL%d\n", level, labelno);
 499 -        printf("LL%d:\n", labelno++);
 500 -        }
 501 -        
 502 -pfstab(sname)
 503 -char *sname; {
 504 -        if (!gdebug) return;
 505 -        pstab(sname, N_FUN);
 506 -        printf("0,%d,_%.7s\n", lineno, sname);
 507 -}
508460 
<_509 -#ifndef ONEPASS
 510 -tlen(p) NODE *p;
 511 -{
 512 -        switch(p->type) {
 513 -                case CHAR:
 514 -                case UCHAR:
 515 -                        return(1);
 516 -                        
 517 -                case SHORT:
 518 -                case USHORT:
 519 -                        return(2);
 520 -                        
 521 -                case DOUBLE:
 522 -                        return(8);
 523 -                        
 524 -                default:
 525 -                        return(4);
 526 -                }
 527 -        }
 528 -#endif
  461+}
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 08:26 +0200