Quick Search:

Mode

Context

Displaying the whole file. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.15
 
1.16
 
MAIN:ragge:20140603201950
 
local.c
_>11 /*      $Id$    */
 22 /*
 33  * Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se).
 44  * All rights reserved.
 55  *
 66  * Redistribution and use in source and binary forms, with or without
 77  * modification, are permitted provided that the following conditions
 88  * are met:
 99  * 1. Redistributions of source code must retain the above copyright
 1010  *    notice, this list of conditions and the following disclaimer.
 1111  * 2. Redistributions in binary form must reproduce the above copyright
 1212  *    notice, this list of conditions and the following disclaimer in the
 1313  *    documentation and/or other materials provided with the distribution.
 1414  *
 1515  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 1616  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 1717  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 1818  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 1919  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 2020  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 2121  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 2222  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 2323  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 2424  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 2525  */
 2626 
 2727 
 2828 # include "pass1.h"
 2929 
 3030 /*      this file contains code which is dependent on the target machine */
 3131 
 3232 NODE *
 3333 clocal(NODE *p)
 3434 {
 3535         struct symtab *q;
 3636         NODE *r, *l;
<> 37+        TWORD t;
3738         int o;
 3839 
<> 40+#ifdef PCC_DEBUG
  41+        if (xdebug) {
  42+                printf("clocal\n");
  43+                fwalk(p, eprint, 0);
  44+        }
  45+#endif
  46+
3947         switch( o = p->n_op ){
 4048         case NAME:
 4149                 /* handle variables */
 4250                 if ((q = p->n_sp) == NULL)
 4351                         return p; /* Nothing to care about */
 4452                 switch (q->sclass) {
<> 53+                case PARAM:
4554                 case AUTO:
<>46 -                        /* fake up a structure reference */
 47 -                        r = block(REG, NIL, NIL, PTR+STRTY, 0, 0);
 48 -                        r->n_lval = 0;
 49 -                        r->n_rval = FPREG;
 50 -                        p = stref(block(STREF, r, p, 0, 0, 0));
  55+                        if (0 && q->soffset < MAXZP * SZINT &&
  56+                            q->sclass != PARAM) {
  57+                                p->n_lval = -(q->soffset/SZCHAR) + ZPOFF*2;
  58+                                p->n_sp = NULL;
  59+                        } else {
  60+                                /* fake up a structure reference */
  61+                                r = block(REG, NIL, NIL, PTR+STRTY, 0, 0);
  62+                                r->n_lval = 0;
  63+                                r->n_rval = FPREG;
  64+                                p = stref(block(STREF, r, p, 0, 0, 0));
  65+                        }
5166                         break;
 5267                 default:
 5368                         break;
 5469                 }
 5570                 break;
 5671 
 5772         case PMCONV:
 5873         case PVCONV:
 5974                 if( p->n_right->n_op != ICON ) cerror( "bad conversion", 0);
 6075                 nfree(p);
<>61 -                return(buildtree(o==PMCONV?MUL:DIV, p->n_left, p->n_right));
  76+                p = (buildtree(o==PMCONV?MUL:DIV, p->n_left, p->n_right));
  77+                break;
6278 
 6379         case PCONV:
<> 80+                t = p->n_type;
  81+                if (t == INCREF(CHAR) || t == INCREF(UCHAR) ||
  82+                    t == INCREF(BOOL) || t == INCREF(VOID))
  83+                        break;
6484                 l = p->n_left;
<> 85+                t = l->n_type;
  86+                if (t == INCREF(CHAR) || t == INCREF(UCHAR) ||
  87+                    t == INCREF(BOOL) || t == INCREF(VOID))
  88+                        break;
  89+                if (p->n_type <= UCHAR || l->n_type <= UCHAR)
  90+                        break; /* must do runtime ptr conv */
6591                 /* if conversion to another pointer type, just remove */
 6692                 if (p->n_type > BTMASK && l->n_type > BTMASK)
 6793                         goto delp;
<> 94+                if (l->n_op == ICON && l->n_sp == NULL)
  95+                        goto delp;
6896                 break;
 6997 
 7098         delp:   l->n_type = p->n_type;
 7199                 l->n_qual = p->n_qual;
 72100                 l->n_df = p->n_df;
 73101                 l->n_ap = p->n_ap;
<>74 -                nfree(p);
 75 -                p = l;
  102+                p = nfree(p);
76103                 break;
 77104         }
 78105 
<> 106+#ifdef PCC_DEBUG
  107+        if (xdebug) {
  108+                printf("clocal end\n");
  109+                fwalk(p, eprint, 0);
  110+        }
  111+#endif
  112+
79113 #if 0
 80114         register struct symtab *q;
 81115         register NODE *r, *l;
 82116         register int o;
 83117         register int m;
 84118         TWORD t;
 85119 
 86120 //printf("in:\n");
 87121 //fwalk(p, eprint, 0);
 88122         switch( o = p->n_op ){
 89123 
 90124         case NAME:
 91125                 if ((q = p->n_sp) == NULL)
 92126                         return p; /* Nothing to care about */
 93127 
 94128                 switch (q->sclass) {
 95129 
 96130                 case PARAM:
 97131                 case AUTO:
 98132                         /* fake up a structure reference */
 99133                         r = block(REG, NIL, NIL, PTR+STRTY, 0, 0);
 100134                         r->n_lval = 0;
 101135                         r->n_rval = FPREG;
 102136                         p = stref(block(STREF, r, p, 0, 0, 0));
 103137                         break;
 104138 
 105139                 case STATIC:
 106140                         if (q->slevel == 0)
 107141                                 break;
 108142                         p->n_lval = 0;
 109143                         p->n_sp = q;
 110144                         break;
 111145 
 112146                 case REGISTER:
 113147                         p->n_op = REG;
 114148                         p->n_lval = 0;
 115149                         p->n_rval = q->soffset;
 116150                         break;
 117151 
 118152                         }
 119153                 break;
 120154 
 121155         case STCALL:
 122156         case CALL:
 123157                 /* Fix function call arguments. On x86, just add funarg */
 124158                 for (r = p->n_right; r->n_op == CM; r = r->n_left) {
 125159                         if (r->n_right->n_op != STARG &&
 126160                             r->n_right->n_op != FUNARG)
 127161                                 r->n_right = block(FUNARG, r->n_right, NIL,
 128162                                     r->n_right->n_type, r->n_right->n_df,
 129163                                     r->n_right->n_sue);
 130164                 }
 131165                 if (r->n_op != STARG && r->n_op != FUNARG) {
 132166                         l = talloc();
 133167                         *l = *r;
 134168                         r->n_op = FUNARG; r->n_left = l; r->n_type = l->n_type;
 135169                 }
 136170                 break;
 137171                 
 138172         case CBRANCH:
 139173                 l = p->n_left;
 140174 
 141175                 /*
 142176                  * Remove unnecessary conversion ops.
 143177                  */
 144178                 if (clogop(l->n_op) && l->n_left->n_op == SCONV) {
 145179                         if (coptype(l->n_op) != BITYPE)
 146180                                 break;
 147181                         if (l->n_right->n_op == ICON) {
 148182                                 r = l->n_left->n_left;
 149183                                 if (r->n_type >= FLOAT && r->n_type <= LDOUBLE)
 150184                                         break;
 151185                                 /* Type must be correct */
 152186                                 t = r->n_type;
 153187                                 nfree(l->n_left);
 154188                                 l->n_left = r;
 155189                                 l->n_type = t;
 156190                                 l->n_right->n_type = t;
 157191                         }
 158192                 }
 159193                 break;
 160194 
 161195         case PCONV:
 162196                 /* Remove redundant PCONV's. Be careful */
 163197                 l = p->n_left;
 164198                 if (l->n_op == ICON) {
 165199                         l->n_lval = (unsigned)l->n_lval;
 166200                         goto delp;
 167201                 }
 168202                 if (l->n_type < INT || l->n_type == LONGLONG ||
 169203                     l->n_type == ULONGLONG) {
 170204                         /* float etc? */
 171205                         p->n_left = block(SCONV, l, NIL,
 172206                             UNSIGNED, 0, 0);
 173207                         break;
 174208                 }
 175209                 /* if left is SCONV, cannot remove */
 176210                 if (l->n_op == SCONV)
 177211                         break;
 178212                 /* if conversion to another pointer type, just remove */
 179213                 if (p->n_type > BTMASK && l->n_type > BTMASK)
 180214                         goto delp;
 181215                 break;
 182216 
 183217         delp:   l->n_type = p->n_type;
 184218                 l->n_qual = p->n_qual;
 185219                 l->n_df = p->n_df;
 186220                 l->n_sue = p->n_sue;
 187221                 nfree(p);
 188222                 p = l;
 189223                 break;
 190224 
 191225         case SCONV:
 192226                 l = p->n_left;
 193227 
 194228                 if (p->n_type == l->n_type) {
 195229                         nfree(p);
 196230                         return l;
 197231                 }
 198232 
 199233                 if ((p->n_type & TMASK) == 0 && (l->n_type & TMASK) == 0 &&
 200234                     btdims[p->n_type].suesize == btdims[l->n_type].suesize) {
 201235                         if (p->n_type != FLOAT && p->n_type != DOUBLE &&
 202236                             l->n_type != FLOAT && l->n_type != DOUBLE &&
 203237                             l->n_type != LDOUBLE && p->n_type != LDOUBLE) {
 204238                                 if (l->n_op == NAME || l->n_op == UMUL ||
 205239                                     l->n_op == TEMP) {
 206240                                         l->n_type = p->n_type;
 207241                                         nfree(p);
 208242                                         return l;
 209243                                 }
 210244                         }
 211245                 }
 212246 
 213247                 if (DEUNSIGN(p->n_type) == INT && DEUNSIGN(l->n_type) == INT &&
 214248                     coptype(l->n_op) == BITYPE) {
 215249                         l->n_type = p->n_type;
 216250                         nfree(p);
 217251                         return l;
 218252                 }
 219253 
 220254                 o = l->n_op;
 221255                 m = p->n_type;
 222256 
 223257                 if (o == ICON) {
 224258                         CONSZ val = l->n_lval;
 225259 
 226260                         if (!ISPTR(m)) /* Pointers don't need to be conv'd */
 227261                             switch (m) {
 228262                         case CHAR:
 229263                                 l->n_lval = (char)val;
 230264                                 break;
 231265                         case UCHAR:
 232266                                 l->n_lval = val & 0377;
 233267                                 break;
 234268                         case SHORT:
 235269                                 l->n_lval = (short)val;
 236270                                 break;
 237271                         case USHORT:
 238272                                 l->n_lval = val & 0177777;
 239273                                 break;
 240274                         case ULONG:
 241275                         case UNSIGNED:
 242276                                 l->n_lval = val & 0xffffffff;
 243277                                 break;
 244278                         case LONG:
 245279                         case INT:
 246280                                 l->n_lval = (int)val;
 247281                                 break;
 248282                         case LONGLONG:
 249283                                 l->n_lval = (long long)val;
 250284                                 break;
 251285                         case ULONGLONG:
 252286                                 l->n_lval = val;
 253287                                 break;
 254288                         case VOID:
 255289                                 break;
 256290                         case LDOUBLE:
 257291                         case DOUBLE:
 258292                         case FLOAT:
 259293                                 l->n_op = FCON;
 260294                                 l->n_dcon = val;
 261295                                 break;
 262296                         default:
 263297                                 cerror("unknown type %d", m);
 264298                         }
 265299                         l->n_type = m;
 266300                         l->n_sue = 0;
 267301                         nfree(p);
 268302                         return l;
 269303                 }
 270304                 if (DEUNSIGN(p->n_type) == SHORT &&
 271305                     DEUNSIGN(l->n_type) == SHORT) {
 272306                         nfree(p);
 273307                         p = l;
 274308                 }
 275309                 if ((p->n_type == CHAR || p->n_type == UCHAR ||
 276310                     p->n_type == SHORT || p->n_type == USHORT) &&
 277311                     (l->n_type == FLOAT || l->n_type == DOUBLE ||
 278312                     l->n_type == LDOUBLE)) {
 279313                         p = block(SCONV, p, NIL, p->n_type, p->n_df, p->n_sue);
 280314                         p->n_left->n_type = INT;
 281315                         return p;
 282316                 }
 283317                 break;
 284318 
 285319         case MOD:
 286320         case DIV:
 287321                 if (o == DIV && p->n_type != CHAR && p->n_type != SHORT)
 288322                         break;
 289323                 if (o == MOD && p->n_type != CHAR && p->n_type != SHORT)
 290324                         break;
 291325                 /* make it an int division by inserting conversions */
 292326                 p->n_left = block(SCONV, p->n_left, NIL, INT, 0, 0);
 293327                 p->n_right = block(SCONV, p->n_right, NIL, INT, 0, 0);
 294328                 p = block(SCONV, p, NIL, p->n_type, 0, 0);
 295329                 p->n_left->n_type = INT;
 296330                 break;
 297331 
 298332         case PMCONV:
 299333         case PVCONV:
 300334                 if( p->n_right->n_op != ICON ) cerror( "bad conversion", 0);
 301335                 nfree(p);
 302336                 return(buildtree(o==PMCONV?MUL:DIV, p->n_left, p->n_right));
 303337 
 304338         case FORCE:
 305339                 /* put return value in return reg */
 306340                 p->n_op = ASSIGN;
 307341                 p->n_right = p->n_left;
 308342                 p->n_left = block(REG, NIL, NIL, p->n_type, 0, 0);
 309343                 p->n_left->n_rval = RETREG(p->n_type);
 310344                 break;
 311345 
 312346         case LS:
 313347         case RS:
 314348                 /* shift count must be in a char
 315349                  * unless longlong, where it must be int */
 316350                 if (p->n_right->n_op == ICON)
 317351                         break; /* do not do anything */
 318352                 if (p->n_type == LONGLONG || p->n_type == ULONGLONG) {
 319353                         if (p->n_right->n_type != INT)
 320354                                 p->n_right = block(SCONV, p->n_right, NIL,
 321355                                     INT, 0, 0);
 322356                         break;
 323357                 }
 324358                 if (p->n_right->n_type == CHAR || p->n_right->n_type == UCHAR)
 325359                         break;
 326360                 p->n_right = block(SCONV, p->n_right, NIL,
 327361                     CHAR, 0, 0);
 328362                 break;
 329363         }
 330364 //printf("ut:\n");
 331365 //fwalk(p, eprint, 0);
 332366 
 333367 #endif
 334368 
 335369         return(p);
 336370 }
 337371 
 338372 void
 339373 myp2tree(NODE *p)
 340374 {
 341375         struct symtab *sp;
<> 376+        NODE *l, *r;
342377         int o = p->n_op;
 343378 
<>344 -        if (o != FCON)
 345 -                return;
  379+        switch (o) {
  380+        case NAME: /* reading from a name must be done with a subroutine */
  381+                if (p->n_type != CHAR && p->n_type != UCHAR)
  382+                        break;
  383+                l = buildtree(ADDROF, ccopy(p), NIL);
  384+                r = block(NAME, NIL, NIL, INT, 0, 0);
346385 
<>347 -        sp = inlalloc(sizeof(struct symtab));
 348 -        sp->sclass = STATIC;
 349 -        sp->sap = 0;
 350 -        sp->slevel = 1; /* fake numeric label */
 351 -        sp->soffset = getlab();
 352 -        sp->sflags = 0;
 353 -        sp->stype = p->n_type;
 354 -        sp->squal = (CON >> TSHIFT);
  386+                r->n_sp = lookup(addname("__nova_rbyte"), SNORMAL);
  387+                if (r->n_sp->sclass == SNULL) {
  388+                        r->n_sp->sclass = EXTERN;
  389+                        r->n_sp->stype = INCREF(p->n_type)+(FTN-PTR);
  390+                }
  391+                r->n_type = r->n_sp->stype;
  392+                r = clocal(r);
  393+                r = optim(buildtree(CALL, r, l));
  394+                *p = *r;
  395+                nfree(r);
  396+                break;
355397 
<>356 -        defloc(sp);
 357 -        ninval(0, tsize(sp->stype, sp->sdf, sp->sap), p);
  398+        case FCON:
  399+                sp = inlalloc(sizeof(struct symtab));
  400+                sp->sclass = STATIC;
  401+                sp->sap = 0;
  402+                sp->slevel = 1; /* fake numeric label */
  403+                sp->soffset = getlab();
  404+                sp->sflags = 0;
  405+                sp->stype = p->n_type;
  406+                sp->squal = (CON >> TSHIFT);
358407 
<>359 -        p->n_op = NAME;
 360 -        p->n_lval = 0;
 361 -        p->n_sp = sp;
  408+                defloc(sp);
  409+                ninval(0, tsize(sp->stype, sp->sdf, sp->sap), p);
362410 
<> 411+                p->n_op = NAME;
  412+                p->n_lval = 0;
  413+                p->n_sp = sp;
  414+        }
363415 }
 364416 
 365417 /*ARGSUSED*/
 366418 int
 367419 andable(NODE *p)
 368420 {
 369421         return(1);  /* all names can have & taken on them */
 370422 }
 371423 
 372424 /*
 373425  * Return 1 if a variable of type type is OK to put in register.
 374426  */
 375427 int
 376428 cisreg(TWORD t)
 377429 {
 378430         return 1; /* try to put anything in a register */
 379431 }
 380432 
 381433 /*
 382434  * return a node, for structure references, which is suitable for
 383435  * being added to a pointer of type t, in order to be off bits offset
 384436  * into a structure
 385437  * t, d, and s are the type, dimension offset, and sizeoffset
 386438  * For nova, return the type-specific index number which calculation
 387439  * is based on its size. For example, char a[3] would return 3.
 388440  * Be careful about only handling first-level pointers, the following
 389441  * indirections must be fullword.
 390442  */
 391443 NODE *
 392444 offcon(OFFSZ off, TWORD t, union dimfun *d, struct attr *ap)
 393445 {
 394446         register NODE *p;
 395447 
 396448         if (xdebug)
 397449                 printf("offcon: OFFSZ %ld type %x dim %p siz %ld\n",
 398450                     off, t, d, tsize(t, d, ap));
 399451 
<>400 -        p = bcon(0);
 401 -        p->n_lval = off/SZINT;  /* Default */
 402 -        if (ISPTR(DECREF(t)))
 403 -                return p;
 404 -        if (t == VOID || t == CHAR || t == UCHAR)
  452+        p = bcon(off/SZINT);
  453+        if (t == INCREF(CHAR) || t == INCREF(UCHAR) || t == INCREF(VOID))
405454                 p->n_lval = off/SZCHAR; /* pointer to char */
 406455         return(p);
 407456 }
 408457 
 409458 /*
 410459  * Allocate off bits on the stack.  p is a tree that when evaluated
 411460  * is the multiply count for off, t is a NAME node where to write
 412461  * the allocated address.
 413462  */
 414463 void
 415464 spalloc(NODE *t, NODE *p, OFFSZ off)
 416465 {
 417466         NODE *sp;
 418467 
 419468 cerror("spalloc");
 420469         if ((off % SZINT) == 0)
 421470                 pbuildtree(MUL, p, bcon(off/SZINT));
 422471         else if ((off % SZSHORT) == 0) {
 423472                 p = buildtree(MUL, p, bcon(off/SZSHORT));
 424473                 p = buildtree(PLUS, p, bcon(1));
 425474                 p = buildtree(RS, p, bcon(1));
 426475         } else if ((off % SZCHAR) == 0) {
 427476                 p = buildtree(MUL, p, bcon(off/SZCHAR));
 428477                 p = buildtree(PLUS, p, bcon(3));
 429478                 p = buildtree(RS, p, bcon(2));
 430479         } else
 431480                 cerror("roundsp");
 432481 
 433482         /* save the address of sp */
 434483         sp = block(REG, NIL, NIL, PTR+INT, t->n_df, t->n_ap);
 435484         sp->n_lval = 0;
 436485         sp->n_rval = STKREG;
 437486         t->n_type = sp->n_type;
 438487         ecomp(buildtree(ASSIGN, t, sp)); /* Emit! */
 439488 
 440489         /* add the size to sp */
 441490         sp = block(REG, NIL, NIL, p->n_type, 0, 0);
 442491         sp->n_lval = 0;
 443492         sp->n_rval = STKREG;
 444493         ecomp(buildtree(PLUSEQ, sp, p));
 445494 }
 446495 
 447496 /*
 448497  * print out a constant node
 449498  * mat be associated with a label
 450499  */
 451500 int
 452501 ninval(CONSZ off, int fsz, NODE *p)
 453502 {
 454503         switch (p->n_type) {
 455504         case FLOAT:
 456505         case DOUBLE:
 457506         case LDOUBLE:
 458507                 cerror("ninval");
 459508         }
 460509         return 1;
 461510 }
 462511 
 463512 /* make a name look like an external name in the local machine */
 464513 char *
 465514 exname(char *p)
 466515 {
 467516         if (p == NULL)
 468517                 return "";
 469518         return p;
 470519 }
 471520 
 472521 /*
 473522  * map types which are not defined on the local machine
 474523  */
 475524 TWORD
 476525 ctype(TWORD type)
 477526 {
 478527         switch (BTYPE(type)) {
 479528         case LONGLONG:
 480529                 MODTYPE(type,LONG);
 481530                 break;
 482531 
 483532         case ULONGLONG:
 484533                 MODTYPE(type,ULONG);
 485534                 break;
 486535         case SHORT:
 487536                 MODTYPE(type,INT);
 488537                 break;
 489538         case USHORT:
 490539                 MODTYPE(type,UNSIGNED);
 491540                 break;
 492541         }
 493542         return (type);
 494543 }
 495544 
 496545 #if 0
 497546 /* curid is a variable which is defined but
 498547  * is not initialized (and not a function );
 499548  * This routine returns the storage class for an uninitialized declaration
 500549  */
 501550 int
 502551 noinit()
 503552 {
 504553         return(EXTERN);
 505554 }
 506555 #endif
 507556 
 508557 void
 509558 calldec(NODE *p, NODE *q)
 510559 {
 511560 }
 512561 
 513562 void
 514563 extdec(struct symtab *q)
 515564 {
 516565 }
 517566 
 518567 #if 0
 519568 /* make a common declaration for id, if reasonable */
 520569 void
 521570 commdec(struct symtab *q)
 522571 {
 523572         int off;
 524573 
 525574         off = tsize(q->stype, q->sdf, q->ssue);
 526575         off = (off+(SZCHAR-1))/SZCHAR;
 527576         printf("        .comm %s,0%o\n", exname(q->soname), off);
 528577 }
 529578 
 530579 /* make a local common declaration for id, if reasonable */
 531580 void
 532581 lcommdec(struct symtab *q)
 533582 {
 534583         int off;
 535584 
 536585         off = tsize(q->stype, q->sdf, q->ssue);
 537586         off = (off+(SZCHAR-1))/SZCHAR;
 538587         if (q->slevel == 0)
 539588                 printf("        .lcomm %s,0%o\n", exname(q->soname), off);
 540589         else
 541590                 printf("        .lcomm " LABFMT ",0%o\n", q->soffset, off);
 542591 }
 543592 
 544593 /*
 545594  * print a (non-prog) label.
 546595  */
 547596 void
 548597 deflab1(int label)
 549598 {
 550599         printf(LABFMT ":\n", label);
 551600 }
 552601 
 553602 static char *loctbl[] = { "text", "data", "section .rodata", "section .rodata" };
 554603 
 555604 void
 556605 setloc1(int locc)
 557606 {
 558607         if (locc == lastloc)
 559608                 return;
 560609         lastloc = locc;
 561610         printf("        .%s\n", loctbl[locc]);
 562611 }
 563612 #endif
 564613 
 565614 /*
 566615  * Give target the opportunity of handling pragmas.
 567616  */
 568617 int
 569618 mypragma(char *str)
 570619 {
 571620         return 0;
 572621 }
 573622 
 574623 /*
 575624  * Called when a identifier has been declared, to give target last word.
<> 625+ * On Nova we put symbols over the size of an int above 24 bytes in
  626+ * offset and leave zeropage for small vars.
576627  */
 577628 void
 578629 fixdef(struct symtab *sp)
 579630 {
<> 631+#if 0
  632+        if (sp->sclass != AUTO)
  633+                return; /* not our business */
  634+        if (ISPTR(sp->stype) || sp->stype < LONG)
  635+                return;
  636+        if (sp->soffset >= (MAXZP * SZINT))
  637+                return; /* already above */
  638+        /* have to move */
  639+        /* XXX remember old autooff for reorg of smaller vars */
  640+        if (autooff < MAXZP * SZINT)
  641+                autooff = MAXZP * SZINT;
  642+        oalloc(sp, &autooff);
  643+#endif
<_580644 }
 581645 
 582646 void
 583647 pass1_lastchance(struct interpass *ip)
 584648 {
 585649 }
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-30 22:01 +0200