# 2.11BSD#431 - /usr/src/lib/mip/xdefs.c

##### Functions

    scnames           X

##### Variables

    asavbc            X
    blevel            X
    brkflag           X
    brklab            X
    cflag             X
    contlab           X
    curclass          X
    curdim            X
    curftn            X
    dcon              X
    fcon              X
    flostat           X
    ftitle            X
    ftnno             X
    hflag             X
    idname            X
    instruct          X
    ititle            X
    lineno            X
    minrvar           X
    node              X
    paramno           X
    pflag             X
    psavbc            X
    reached           X
    regvar            X
    retlab            X
    retstat           X
    stab              X
    strflg            X
    stwart            X
    swp               X
    swtab             X
    swx               X
    xdebug            X

       1: #if !defined(lint) && defined(DOSCCS)
       2: static char *sccsid ="@(#)xdefs.c	4.3 (Berkeley) 3/19/85";
       3: #endif lint
       4:
       5: # include "pass1.h"
       6:
       7: /*	communication between lexical routines	*/
       8:
       9: char    ftitle[100];        /* title of the file */
      10: #ifndef LINT
      11: char    ititle[100];        /* title of initial file */
      12: #endif
      13: int lineno;     /* line number of the input file */
      14:
      15: CONSZ lastcon;  /* the last constant read by the lexical analyzer */
      16: float fcon;   /* the last float read by the lexical analyzer */
      17: double dcon;   /* the last double read by the lexical analyzer */
      18:
      19:
      20: /*	symbol table maintainence */
      21:
      22: struct symtab stab[SYMTSZ+1];  /* one extra slot for scratch */
      23:
      24: int curftn;  /* "current" function */
      25: int ftnno;  /* "current" function number */
      26:
      27: int curclass,     /* current storage class */
      28:     instruct,   /* "in structure" flag */
      29:     stwart,     /* for accessing names which are structure members or names */
      30:     blevel,     /* block level: 0 for extern, 1 for ftn args, >=2 inside function */
      31:     curdim;     /* current offset into the dimension table */
      32:
      33: OFFSZ   dimtab[ DIMTABSZ ]; /* same comments as below.  bit addressing
      34: 				 * everything forces this to be large.
      35: 				*/
      36:
      37: OFFSZ   paramstk[ PARAMSZ ];  /* used in definition of function parameters */
      38:                   /* ordinarily 'int' would be enough, but the
      39: 			       * "bit address" in 'strucoff' (for structures
      40: 			       * over 4kb) needs a 'long' *sigh*
      41: 			      */
      42: int paramno;      /* the number of parameters */
      43: OFFSZ   autooff,    /* the next unused automatic offset */
      44:     argoff,     /* the next unused argument offset */
      45:     strucoff;   /*  the next structure offset position */
      46: int regvar;     /* the next free register for register variables */
      47: int minrvar;    /* the smallest that regvar gets witing a function */
      48: OFFSZ   inoff;      /* offset of external element being initialized */
      49: int brkflag = 0;    /* complain about break statements not reached */
      50:
      51: struct sw swtab[SWITSZ];  /* table for cases within a switch */
      52: struct sw *swp;  /* pointer to next free entry in swtab */
      53: int swx;  /* index of beginning of cases for current switch */
      54:
      55: /* debugging flag */
      56: int xdebug = 0;
      57:
      58: int strflg;  /* if on, strings are to be treated as lists */
      59:
      60: int reached;    /* true if statement can be reached... */
      61:
      62: int idname; /* tunnel to buildtree for name id's */
      63:
      64:
      65: NODE node[TREESZ];
      66:
      67: int cflag = 0;  /* do we check for funny casts */
      68: int hflag = 0;  /* do we check for various heuristics which may indicate errors */
      69: int pflag = 0;  /* do we check for portable constructions */
      70:
      71: int brklab;
      72: int contlab;
      73: int flostat;
      74: int retlab = NOLAB;
      75: int retstat;
      76:
      77: /* save array for break, continue labels, and flostat */
      78:
      79: int asavbc[BCSZ];
      80: int *psavbc = asavbc ;
      81:
      82: # ifndef BUG1
      83: static char *
      84: ccnames[] = { /* names of storage classes */
      85:     "SNULL",
      86:     "AUTO",
      87:     "EXTERN",
      88:     "STATIC",
      89:     "REGISTER",
      90:     "EXTDEF",
      91:     "LABEL",
      92:     "ULABEL",
      93:     "MOS",
      94:     "PARAM",
      95:     "STNAME",
      96:     "MOU",
      97:     "UNAME",
      98:     "TYPEDEF",
      99:     "FORTRAN",
     100:     "ENAME",
     101:     "MOE",
     102:     "UFORTRAN",
     103:     "USTATIC",
     104:     };
     105:
     106: char * scnames( c ) register c; {
     107:     /* return the name for storage class c */
     108:     static char buf[12];
     109:     if( c&FIELD ){
     110:         sprintf( buf, "FIELD[%d]", c&FLDSIZ );
     111:         return( buf );
     112:         }
     113:     return( ccnames[c] );
     114:     }
     115: # endif

#### Defined functions

scnames defined in line 106; used 5 times

- in /usr/src/lib/mip/pass1.h line 60
- in /usr/src/lib/mip/pftn.c line 63, 79-82(2), 142

#### Defined variables

asavbc defined in line 79; used 4 times

- in line 80
- in /usr/src/lib/mip/pftn.c line 416-420(2)
- in /usr/src/lib/mip/xdefs.c line 80

blevel defined in line 30; used 19 times

- in /usr/src/lib/mip/pftn.c line 63, 89, 173, 279, 301, 371, 966-970(2), 1379-1380(2), 1574-1575(2), 1610-1611(2), 1655-1657(2), 1663-1667(2), 1687

brkflag defined in line 49; never used
brklab defined in line 71; used 1 times

- in /usr/src/lib/mip/pftn.c line 413

ccnames defined in line 84; used 1 times

- in line 113

cflag defined in line 67; used 1 times

- in /usr/src/lib/mip/trees.c line 259

contlab defined in line 72; used 1 times

- in /usr/src/lib/mip/pftn.c line 413

curclass defined in line 27; used 9 times

- in /usr/src/lib/mip/pftn.c line 412, 509, 516-526(3), 577, 851(2), 1378

curdim defined in line 31; used 7 times

- in /usr/src/lib/mip/pftn.c line 305, 556, 578, 1497
- in /usr/src/lib/mip/scan.c line 176, 424
- in /usr/src/lib/mip/trees.c line 324

curftn defined in line 24; used 5 times

- in /usr/src/lib/mip/pftn.c line 175, 203, 228, 290, 340

dcon defined in line 17; never used
fcon defined in line 16; never used
flostat defined in line 73; used 1 times

- in /usr/src/lib/mip/pftn.c line 414

ftitle defined in line 9; used 3 times

- in /usr/src/lib/mip/scan.c line 1006, 1026, 1032

ftnno defined in line 25; never used
hflag defined in line 68; used 6 times

- in /usr/src/lib/mip/pftn.c line 1940-1942(2)
- in /usr/src/lib/mip/scan.c line 429
- in /usr/src/lib/mip/trees.c line 105, 158, 631

idname defined in line 62; used 5 times

- in /usr/src/lib/mip/pftn.c line 1065, 1947
- in /usr/src/lib/mip/trees.c line 284, 293, 302

instruct defined in line 28; used 22 times

- in /usr/src/lib/mip/pftn.c line 493, 508-520(4), 575-576(3), 1237, 1380, 1574, 1588, 1608-1609(2), 1636, 1643-1651(3), 1751
- in /usr/src/lib/mip/scan.c line 537-541(2), 926

ititle defined in line 11; used 5 times

- in /usr/src/lib/mip/scan.c line 1007, 1031-1033(2), 1039-1044(2)

lineno defined in line 13; never used
minrvar defined in line 47; used 3 times

- in /usr/src/lib/mip/pftn.c line 372(2), 423

node defined in line 65; never used
paramno defined in line 42; used 14 times

- in /usr/src/lib/mip/pftn.c line 256(2), 399-402(2), 417-421(2), 439, 461-462(2), 533, 583, 649, 1034, 1203

pflag defined in line 69; used 1 times

- in /usr/src/lib/mip/scan.c line 429

psavbc defined in line 80; used 2 times

- in /usr/src/lib/mip/pftn.c line 416-420(2)

reached defined in line 60; used 5 times

- in /usr/src/lib/mip/pftn.c line 424
- in /usr/src/lib/mip/scan.c line 177, 491
- in /usr/src/lib/mip/trees.c line 1557-1559(2)

regvar defined in line 46; used 5 times

- in /usr/src/lib/mip/pftn.c line 370-372(3), 423, 1656

retlab defined in line 74; used 2 times

- in /usr/src/lib/mip/pftn.c line 406, 413

retstat defined in line 75; used 1 times

- in /usr/src/lib/mip/pftn.c line 410

sccsid defined in line 2; never used
stab defined in line 22; used 74 times

- in /usr/src/lib/mip/pftn.c line 53, 257-262(4), 282, 441, 469, 532, 563, 569-571(2), 586, 640-642(2), 666, 677, 683, 689-690(2), 848, 907-908(2), 931, 1023, 1153, 1400, 1711-1715(2), 1722-1724(2), 1765, 1797, 1810-1814(2), 1839, 1847(2), 1889, 1907(2), 1932(2), 1945-1947(3), 1959(2), 1973(2)
- in /usr/src/lib/mip/scan.c line 154, 535
- in /usr/src/lib/mip/trees.c line 284, 349-353(2), 363-364(2), 375, 397-402(2), 410-412(2), 536, 613-615(2), 626-632(4), 639(2), 828, 1604, 1656

strflg defined in line 58; used 4 times

- in /usr/src/lib/mip/pftn.c line 952, 968
- in /usr/src/lib/mip/scan.c line 404, 418

stwart defined in line 29; used 15 times

- in /usr/src/lib/mip/pftn.c line 493, 576, 1751
- in /usr/src/lib/mip/scan.c line 532-541(6), 645, 710, 926, 941, 947, 953

swp defined in line 52; used 1 times

- in /usr/src/lib/mip/pftn.c line 426

swtab defined in line 51; used 1 times

- in /usr/src/lib/mip/pftn.c line 426

swx defined in line 53; used 2 times

- in /usr/src/lib/mip/pftn.c line 418, 425

xdebug defined in line 56; never used

Last modified: 1991-08-17 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1236 |