|
|
1.1 ! root 1: #ifndef C_H_INCLUDED ! 2: #define C_H_INCLUDED ! 3: /* C compiler: definitions */ ! 4: ! 5: /* default sizes */ ! 6: #define MAXLINE 512 /* maximum input/output line length */ ! 7: #define MAXTOKEN 32 /* maximum token length */ ! 8: #define BUFSIZE 4096 /* input buffer size */ ! 9: #define HASHSIZE 128 /* default hash table size */ ! 10: #define MEMINCR 10 /* blocks (1kb) allocated per arena */ ! 11: ! 12: #ifdef __LCC__ ! 13: #ifndef __STDC__ ! 14: #define __STDC__ ! 15: #endif ! 16: #endif ! 17: ! 18: #include "ops.h" ! 19: ! 20: #ifdef __STDC__ ! 21: #include <stdarg.h> ! 22: #define va_init va_start ! 23: ! 24: typedef enum tokencode { ! 25: #define xx(a,b,c,d,e,f,g) a=b, ! 26: #define yy(a,b,c,d,e,f,g) ! 27: #include "token.h" ! 28: NTOKENS ! 29: } Typeop; /* type operators are a subset of tokens */ ! 30: ! 31: #define dclproto(func,args) func args ! 32: typedef void *Generic; ! 33: #else ! 34: #include <varargs.h> ! 35: #define va_init(a,b) va_start(a) ! 36: ! 37: #define xx(a,b,c,d,e,f,g) ! 38: #include "token.h" ! 39: typedef int Typeop; ! 40: ! 41: #define dclproto(func,args) func() ! 42: typedef char *Generic; ! 43: #endif ! 44: ! 45: typedef struct list { /* lists: */ ! 46: Generic x; /* element */ ! 47: struct list *link; /* next node */ ! 48: } *List; ! 49: ! 50: typedef struct coord { /* source coordinates: */ ! 51: char *file; /* file name */ ! 52: unsigned short x, y; /* x,y position in file */ ! 53: } Coordinate; ! 54: typedef union value { /* constant values: */ ! 55: char sc; /* signed */ ! 56: short ss; /* signed */ ! 57: int i; /* signed */ ! 58: unsigned char uc; ! 59: unsigned short us; ! 60: unsigned int u; ! 61: float f; ! 62: double d; ! 63: char *p; /* pointer to anything */ ! 64: } Value; ! 65: ! 66: typedef struct symbol *Symbol; /* symbol table entries */ ! 67: typedef struct table *Table; /* symbol tables */ ! 68: typedef struct tynode *Type; /* type nodes */ ! 69: typedef struct node *Node; /* dag nodes */ ! 70: typedef struct tree *Tree; /* tree nodes */ ! 71: typedef struct field *Field; /* struct/union fields */ ! 72: typedef struct swtch *Swtch; /* switch data */ ! 73: ! 74: typedef struct metrics { ! 75: unsigned char size, align, inline; ! 76: } Metrics; ! 77: ! 78: #include "config.h" ! 79: typedef struct interface { ! 80: char *target; ! 81: Metrics charmetric; ! 82: Metrics shortmetric; ! 83: Metrics intmetric; ! 84: Metrics floatmetric; ! 85: Metrics doublemetric; ! 86: Metrics ptrmetric; ! 87: Metrics structmetric; ! 88: unsigned left_to_right:1; ! 89: unsigned little_endian:1; ! 90: unsigned jump_on_return:1; ! 91: unsigned mulops_are_calls:1; ! 92: unsigned compl_band:1; ! 93: unsigned no_argb:1; ! 94: unsigned no_dag:1; ! 95: dclproto(void (*address),(Symbol, Symbol, int)); ! 96: dclproto(void (*blockbeg),(Env *)); ! 97: dclproto(void (*blockend),(Env *)); ! 98: dclproto(void (*defaddress),(Symbol)); ! 99: dclproto(void (*defconst),(int, Value)); ! 100: dclproto(void (*defstring),(int, char *)); ! 101: dclproto(void (*defsymbol),(Symbol)); ! 102: dclproto(void (*emit),(Node)); ! 103: dclproto(void (*export),(Symbol)); ! 104: dclproto(void (*function),(Symbol, Symbol [], Symbol [], int)); ! 105: dclproto(Node (*gen),(Node)); ! 106: dclproto(void (*global),(Symbol)); ! 107: dclproto(void (*import),(Symbol)); ! 108: dclproto(void (*local),(Symbol)); ! 109: dclproto(void (*progbeg),(int, char **)); ! 110: dclproto(void (*progend),(void)); ! 111: dclproto(void (*segment),(int)); ! 112: dclproto(void (*space),(int)); ! 113: ! 114: dclproto(void (*stabblock),(int, int, Symbol*)); ! 115: dclproto(void (*stabend),(Coordinate *, Symbol, Coordinate **, Symbol *, Symbol *)); ! 116: dclproto(void (*stabfend),(Symbol, int)); ! 117: dclproto(void (*stabinit),(char *, int, char *[])); ! 118: dclproto(void (*stabline),(Coordinate *)); ! 119: dclproto(void (*stabsym),(Symbol)); ! 120: dclproto(void (*stabtype),(Symbol)); ! 121: Xinterface x; ! 122: } Interface; ! 123: extern Interface *interfaces[], *IR; ! 124: ! 125: #ifndef MAXKIDS ! 126: #define MAXKIDS 2 ! 127: #endif ! 128: #ifndef MAXSYMS ! 129: #define MAXSYMS 3 ! 130: #endif ! 131: ! 132: struct node { /* dag nodes: */ ! 133: Opcode op; /* operator */ ! 134: short count; /* reference count */ ! 135: Symbol syms[MAXSYMS]; /* symbols */ ! 136: Node kids[MAXKIDS]; /* operands */ ! 137: Node link; /* next dag in the forest */ ! 138: Xnode x; /* back-end's type extension */ ! 139: }; ! 140: struct tree { /* tree nodes: */ ! 141: Opcode op; /* operator */ ! 142: Type type; /* type of result */ ! 143: Tree kids[2]; /* operands */ ! 144: Node node; /* associated dag node */ ! 145: union { ! 146: Symbol sym; /* associated symbol */ ! 147: Value v; /* associated value */ ! 148: Field field; /* associated struct/union bit field */ ! 149: } u; ! 150: }; ! 151: typedef struct code *Code; ! 152: struct code { /* code list entries: */ ! 153: #ifdef __STDC__ ! 154: enum { ! 155: Blockbeg, Blockend, Local, Address, Defpoint, ! 156: Label, Start, Asm, Gen, Jump, Switch } kind; ! 157: #else ! 158: int kind; ! 159: #define Blockbeg 0 ! 160: #define Blockend 1 ! 161: #define Local 2 ! 162: #define Address 3 ! 163: #define Defpoint 4 ! 164: #define Label 5 ! 165: #define Start 6 ! 166: #define Asm 7 ! 167: #define Gen 8 ! 168: #define Jump 9 ! 169: #define Switch 10 ! 170: #endif ! 171: Code prev; /* previous code node */ ! 172: Code next; /* next code node */ ! 173: union { ! 174: struct { /* Asm: assembly language */ ! 175: char *code; /* assembly code */ ! 176: Symbol *argv; /* %name arguments */ ! 177: } acode; ! 178: struct { /* Blockbeg: */ ! 179: Code prev; /* previous Blockbeg */ ! 180: short bnumber; /* block number */ ! 181: short level; /* block level */ ! 182: Symbol *locals; /* locals */ ! 183: Table identifiers, types;/* symbol tables; used for -g */ ! 184: Env x; /* value filled in by blockbeg() */ ! 185: } block; ! 186: Symbol var; /* Local: local variable */ ! 187: struct { /* Address: */ ! 188: Symbol sym; /* created symbol */ ! 189: Symbol base; /* local or parameter */ ! 190: int offset; /* offset from sym */ ! 191: } addr; ! 192: struct { /* Defpoint: execution point */ ! 193: Coordinate src; /* source location */ ! 194: int point; /* execution point number */ ! 195: } point; ! 196: Node node; /* Label, Gen, Jump: a dag node */ ! 197: struct swselect { /* Switch: swselect data */ ! 198: Symbol sym; /* temporary holding value */ ! 199: Symbol table; /* branch table */ ! 200: Symbol deflab; /* default label */ ! 201: int size; /* size of value & label arrays */ ! 202: int *values; /* value, label pairs */ ! 203: Symbol *labels; ! 204: } swtch; ! 205: } u; ! 206: }; ! 207: typedef struct arena *Arena; ! 208: struct arena { /* storage allocation arena: */ ! 209: int m; /* size of current allocation request */ ! 210: char *avail; /* next available location */ ! 211: char *limit; /* address 1 past end of arena */ ! 212: Arena first; /* pointer to first arena */ ! 213: Arena next; /* link to next arena */ ! 214: }; ! 215: struct symbol { /* symbol structures: */ ! 216: Xsymbol x; /* back-end's type extension */ ! 217: char *name; /* name */ ! 218: unsigned short scope; /* scope level */ ! 219: unsigned char sclass; /* storage class */ ! 220: unsigned defined:1; /* 1 if defined */ ! 221: unsigned temporary:1; /* 1 if a temporary */ ! 222: unsigned generated:1; /* 1 if a generated identifier */ ! 223: unsigned computed:1; /* 1 if an address computation identifier */ ! 224: unsigned addressed:1; /* 1 if its address is taken */ ! 225: unsigned structarg:1; /* 1 if parameter is a struct */ ! 226: float ref; /* # of references */ ! 227: Type type; /* data type */ ! 228: Coordinate src; /* definition coordinate */ ! 229: Coordinate **uses; /* array of Coordinate *'s for uses (omit) */ ! 230: Symbol up; /* next symbol in this or outer scope */ ! 231: union { ! 232: struct { /* labels: */ ! 233: int label; /* label number */ ! 234: Symbol equatedto; /* equivalent label */ ! 235: } l; ! 236: struct { /* struct/union types: */ ! 237: unsigned cfields:1; /* 1 if >= 1 const fields */ ! 238: unsigned vfields:1; /* 1 if >= 1 volatile fields */ ! 239: Table ftab; /* if xref != 0, table of field names */ ! 240: Field flist; /* field list */ ! 241: } s; ! 242: int value; /* enumeration identifiers: value */ ! 243: Symbol *idlist; /* enumeration types: identifiers */ ! 244: struct { /* constants: */ ! 245: Value v; /* value */ ! 246: Symbol loc; /* out-of-line location */ ! 247: } c; ! 248: struct { /* functions: */ ! 249: Coordinate pt[3];/* source code coordinates */ ! 250: int label; /* exit label */ ! 251: int ncalls; /* # calls in this function */ ! 252: Symbol *callee; /* parameter symbols */ ! 253: } f; ! 254: int seg; /* globals, statics: definition segment */ ! 255: } u; ! 256: #ifdef Ysymbol ! 257: Ysymbol y; ! 258: #endif ! 259: }; ! 260: #ifdef __STDC__ ! 261: enum { CONSTANTS=1, LABELS, GLOBAL, PARAM, LOCAL }; ! 262: #else ! 263: #define CONSTANTS 1 ! 264: #define LABELS 2 ! 265: #define GLOBAL 3 ! 266: #define PARAM 4 ! 267: #define LOCAL 5 ! 268: #endif ! 269: typedef struct { ! 270: unsigned printed:1; ! 271: unsigned marked:1; ! 272: unsigned short typeno; ! 273: } Xtype; ! 274: ! 275: struct tynode { /* type nodes: */ ! 276: Typeop op; /* operator */ ! 277: short align; /* alignment in storage units */ ! 278: int size; /* size in storage units */ ! 279: Type type; /* operand */ ! 280: union { ! 281: Symbol sym; /* associated symbol */ ! 282: struct { /* function types */ ! 283: unsigned oldstyle:1; /* 1 if an old-style function type */ ! 284: Type *proto; /* prototype */ ! 285: } f; ! 286: } u; ! 287: Xtype x; /* symbol table information */ ! 288: #ifdef Ytype ! 289: Ytype y; ! 290: #endif ! 291: }; ! 292: struct field { /* struct/union fields: */ ! 293: char *name; /* field name */ ! 294: Type type; /* data type */ ! 295: int offset; /* field offset */ ! 296: short bitsize; /* field size in bits */ ! 297: short lsb; /* lsb bit of the field; rightmost bit is bit 1 */ ! 298: Field link; /* next field in this type */ ! 299: }; ! 300: ! 301: /* limits */ ! 302: #ifdef __LCC__ ! 303: #include <limits.h> ! 304: #include <float.h> ! 305: #else ! 306: /* ! 307: * The magnitudes of the values below are greater than or equal to the minimum ! 308: * permitted by the standard (see Appendix D) and are typical for byte-addressed ! 309: * machines with 32-bit integers. These values are suitable for bootstrapping. ! 310: */ ! 311: #define CHAR_BIT 8 ! 312: #define MB_LEN_MAX 1 ! 313: ! 314: #define UCHAR_MAX 0xff ! 315: #define USHRT_MAX 0xffff ! 316: #define UINT_MAX 0xffffffff ! 317: #define ULONG_MAX 0xffffffffL ! 318: ! 319: #define CHAR_MAX SCHAR_MAX ! 320: #define SCHAR_MAX 0x7f ! 321: #define SHRT_MAX 0x7fff ! 322: #define INT_MAX 0x7fffffff ! 323: #define LONG_MAX 0x7fffffffL ! 324: ! 325: #define CHAR_MIN SCHAR_MIN ! 326: #define SCHAR_MIN (-SCHAR_MAX-1) ! 327: #define SHRT_MIN (-SHRT_MAX-1) ! 328: #define INT_MIN (-INT_MAX-1) ! 329: #define LONG_MIN (-LONG_MAX-1) ! 330: ! 331: #define FLT_MAX 1e37 ! 332: #define DBL_MAX 1e37 ! 333: #endif ! 334: ! 335: #ifdef __STDC__ ! 336: enum { CODE=1, BSS, DATA, LIT, SYM }; /* logical segments */ ! 337: #else ! 338: #define CODE 1 ! 339: #define BSS 2 ! 340: #define DATA 3 ! 341: #define LIT 4 ! 342: #define SYM 5 ! 343: #define CONSTANTS 1 ! 344: #define LABELS 2 ! 345: #define GLOBAL 3 ! 346: #define PARAM 4 ! 347: #define LOCAL 5 ! 348: #endif ! 349: ! 350: /* misc. macros */ ! 351: #define roundup(x,n) (((x)+((n)-1))&(~((n)-1))) ! 352: #define utod(x) (2.*(int)((unsigned)(x)>>1)+(int)((x)&1)) ! 353: #ifdef NDEBUG ! 354: #define assert(c) ! 355: #else ! 356: #define assert(c) ((c) || fatal(__FILE__,"assertion failure at line %d\n",\ ! 357: __LINE__)) ! 358: #endif ! 359: ! 360: /* C library */ ! 361: #ifndef strtod ! 362: dclproto(extern double strtod,(char *, char **)); ! 363: #endif ! 364: dclproto(extern int atoi,(char *)); ! 365: dclproto(extern int close,(int)); ! 366: dclproto(extern int creat,(char *, int)); ! 367: dclproto(extern void exit,(int)); ! 368: dclproto(extern Generic malloc,(unsigned)); ! 369: dclproto(extern int open,(char *, int)); ! 370: dclproto(extern int read,(int, char *, int)); ! 371: dclproto(extern long strtol,(char *, char **, int)); ! 372: dclproto(extern int sprintf,(char *, const char *, ...)); ! 373: dclproto(extern char *strchr,(const char *, int)); ! 374: dclproto(extern int strcmp,(const char *, const char *)); ! 375: dclproto(extern unsigned strlen,(const char *)); ! 376: dclproto(extern char *strncmp,(const char *, const char *, unsigned)); ! 377: dclproto(extern char *strncpy,(char *, const char *, unsigned)); ! 378: dclproto(extern int write,(int, char *, int)); ! 379: ! 380: extern int bnumber; ! 381: extern Table constants; ! 382: extern Table externals; ! 383: extern Table globals; ! 384: extern Table identifiers; ! 385: extern Table labels[2]; ! 386: /*G*/extern Table types; ! 387: extern int level; ! 388: extern List symbols; ! 389: #define islabel(p) ((p) && (p)->op == LABEL+V && (p)->syms[0]) ! 390: #define yyalloc(n,ap) (ap->m = roundup(n,sizeof(double)), \ ! 391: ap->avail + ap->m >= ap->limit ? allocate(ap->m, &ap) : \ ! 392: (ap->avail += ap->m, ap->avail - ap->m)) ! 393: #define alloc(n) yyalloc(n, permanent) ! 394: #define talloc(n) yyalloc(n, transient) ! 395: #define BZERO(p,t) \ ! 396: { unsigned *q1 = (unsigned *)(p), *q2 = q1 + ((sizeof (t)/sizeof (unsigned))&~(8-1)); \ ! 397: for ( ; q1 < q2; q1 += 8) \ ! 398: q1[0] = q1[1] = q1[2] = q1[3] = q1[4] = q1[5] = q1[6] = q1[7] = 0; \ ! 399: sizeof (t)/sizeof (unsigned)%8 >= 1 ? q1[0] = 0 : 0; \ ! 400: sizeof (t)/sizeof (unsigned)%8 >= 2 ? q1[1] = 0 : 0; \ ! 401: sizeof (t)/sizeof (unsigned)%8 >= 3 ? q1[2] = 0 : 0; \ ! 402: sizeof (t)/sizeof (unsigned)%8 >= 4 ? q1[3] = 0 : 0; \ ! 403: sizeof (t)/sizeof (unsigned)%8 >= 5 ? q1[4] = 0 : 0; \ ! 404: sizeof (t)/sizeof (unsigned)%8 >= 6 ? q1[5] = 0 : 0; \ ! 405: sizeof (t)/sizeof (unsigned)%8 >= 7 ? q1[6] = 0 : 0; \ ! 406: sizeof (t)%sizeof (unsigned) >= 1 ? ((char *)(q1 + sizeof (t)/sizeof (unsigned)%8))[0] = 0 : 0; \ ! 407: sizeof (t)%sizeof (unsigned) >= 2 ? ((char *)(q1 + sizeof (t)/sizeof (unsigned)%8))[1] = 0 : 0; \ ! 408: sizeof (t)%sizeof (unsigned) >= 3 ? ((char *)(q1 + sizeof (t)/sizeof (unsigned)%8))[2] = 0 : 0; \ ! 409: } ! 410: #define fieldsize(p) (p)->bitsize ! 411: #define fieldright(p) ((p)->lsb - 1) ! 412: #define fieldmask(p) (~(~(unsigned)0<<fieldsize(p))) ! 413: #define fieldleft(p) (8*(p)->type->size - fieldsize(p) - fieldright(p)) ! 414: /* ! 415: * type-checking macros. ! 416: * the operator codes are defined in token.h ! 417: * to permit the range tests below; don't change them. ! 418: */ ! 419: #define isqual(t) ((t)->op >= CONST) ! 420: #define isvolatile(t) ((t)->op == VOLATILE || (t)->op == CONST+VOLATILE) ! 421: #define isconst(t) ((t)->op == CONST || (t)->op == CONST+VOLATILE) ! 422: #define unqual(t) (isqual(t) ? (t)->type : t) ! 423: #define isarray(t) (unqual(t)->op == ARRAY) ! 424: #define isstruct(t) (unqual(t)->op == STRUCT || unqual(t)->op == UNION) ! 425: #define isunion(t) (unqual(t)->op == UNION) ! 426: #define isfunc(t) (unqual(t)->op == FUNCTION) ! 427: #define isptr(t) (unqual(t)->op == POINTER) ! 428: #define ischar(t) (unqual(t)->op == CHAR) ! 429: #define isint(t) (unqual(t)->op >= CHAR && unqual(t)->op <= UNSIGNED) ! 430: #define isfloat(t) (unqual(t)->op <= DOUBLE) ! 431: #define isarith(t) (unqual(t)->op <= UNSIGNED) ! 432: #define isunsigned(t) (unqual(t)->op == UNSIGNED) ! 433: #define isdouble(t) (unqual(t)->op == DOUBLE) ! 434: #define isscalar(t) (unqual(t)->op <= POINTER || unqual(t)->op == ENUM) ! 435: #define isenum(t) (unqual(t)->op == ENUM) ! 436: #define widen(t) (isint(t) || isenum(t) ? INT : ttob(t)) ! 437: dclproto(extern List append,(Generic, List)); ! 438: dclproto(extern int length,(List)); ! 439: dclproto(extern Generic *ltoa,(List, Generic [])); ! 440: /*G*/dclproto(extern char *string,(char *)); ! 441: /*G*/dclproto(extern char *stringd,(int)); ! 442: dclproto(extern char *stringn,(char *, int)); ! 443: ! 444: dclproto(extern Symbol constant,(Type, Value)); ! 445: dclproto(extern void enterscope,(void)); ! 446: dclproto(extern void exitscope,(void)); ! 447: dclproto(extern void fielduses,(Symbol, Generic)); ! 448: dclproto(extern Symbol findlabel,(int)); ! 449: dclproto(extern Symbol findtype,(Type)); ! 450: /*G*/dclproto(extern void foreach,(Table, int, void (*)(Symbol, Generic), Generic)); ! 451: dclproto(extern Symbol genident,(int, Type, int)); ! 452: /*G*/dclproto(extern int genlabel,(int)); ! 453: dclproto(extern Symbol install,(char *, Table *, int)); ! 454: dclproto(extern Symbol intconst,(int)); ! 455: dclproto(extern void locus,(Table, Coordinate *)); ! 456: dclproto(extern Symbol lookup,(char *, Table)); ! 457: /*G*/dclproto(extern Symbol newtemp,(int, int)); ! 458: dclproto(extern void rmtemps,(int, int)); ! 459: dclproto(extern void release,(Symbol)); ! 460: dclproto(extern void setuses,(Table)); ! 461: dclproto(extern Table table,(Table, int)); ! 462: dclproto(extern Symbol temporary,(int, Type)); ! 463: dclproto(extern void use,(Symbol, Coordinate)); ! 464: ! 465: dclproto(extern void addlocal,(Symbol)); ! 466: dclproto(extern Type btot,(int)); ! 467: dclproto(extern Code code,(int)); ! 468: /*G*/dclproto(extern void emitcode,(void)); ! 469: /*G*/dclproto(extern void gencode,(Symbol [], Symbol [])); ! 470: dclproto(extern Node listnodes,(Tree, int, int)); ! 471: dclproto(extern Node jump,(int)); ! 472: /*G*/dclproto(extern Node newnode,(int, Node, Node, Symbol)); ! 473: dclproto(extern Node node,(int, Node, Node, Symbol)); ! 474: dclproto(extern void printdag,(Node, int)); ! 475: dclproto(extern void walk,(Tree, int, int)); ! 476: extern struct code codehead; ! 477: extern Code codelist; ! 478: extern int nodecount; ! 479: dclproto(extern void compound,(int, Swtch, int)); ! 480: dclproto(extern void finalize,(void)); ! 481: dclproto(extern void program,(void)); ! 482: dclproto(extern Type typename,(void)); ! 483: extern Symbol cfunc; ! 484: extern char *fname; ! 485: extern Symbol retv; ! 486: dclproto(extern int genconst,(Tree, int)); ! 487: dclproto(extern int hascall,(Tree)); ! 488: dclproto(extern int nodeid,(Tree)); ! 489: dclproto(extern char *opname,(int)); ! 490: dclproto(extern int *printed,(int)); ! 491: dclproto(extern void printtree,(Tree, int)); ! 492: dclproto(extern Tree retype,(Tree, Type)); ! 493: dclproto(extern Tree root,(Tree)); ! 494: dclproto(extern Tree texpr,(Tree (*)(int), int)); ! 495: dclproto(extern void tfree,(void)); ! 496: dclproto(extern Tree tree,(int, Type, Tree, Tree)); ! 497: extern int ntree; ! 498: dclproto(extern Tree addrof,(Tree)); ! 499: dclproto(extern Tree asgn,(Symbol, Tree)); ! 500: dclproto(extern Type assign,(Type, Tree)); ! 501: dclproto(extern Tree cast,(Tree, Type)); ! 502: dclproto(extern Tree cond,(Tree)); ! 503: dclproto(extern Tree conditional,(int)); ! 504: dclproto(extern Tree constexpr,(int)); ! 505: dclproto(extern Tree expr0,(int)); ! 506: dclproto(extern Tree expr,(int)); ! 507: dclproto(extern Tree expr1,(int)); ! 508: dclproto(extern Tree field,(Tree, char *)); ! 509: dclproto(extern char *funcname,(Tree)); ! 510: dclproto(extern Tree idnode,(Symbol)); ! 511: dclproto(extern Tree incr,(int, Tree, Tree)); ! 512: dclproto(extern int intexpr,(int, int)); ! 513: dclproto(extern Tree lvalue,(Tree)); ! 514: dclproto(extern Tree pointer,(Tree)); ! 515: dclproto(extern Type promote,(Type)); ! 516: dclproto(extern Tree right,(Tree, Tree)); ! 517: dclproto(extern Tree rvalue,(Tree)); ! 518: dclproto(extern Tree cvtconst,(Tree)); ! 519: dclproto(extern void defglobal,(Symbol, int)); ! 520: dclproto(extern void defpointer,(Symbol)); ! 521: dclproto(extern void doconst,(Symbol, Generic)); ! 522: dclproto(extern int genconst,(Tree, int)); ! 523: dclproto(extern void initglobal,(Symbol, int)); ! 524: dclproto(extern Type initializer,(Type, int)); ! 525: dclproto(extern Tree structexp,(Type, Symbol)); ! 526: dclproto(extern void swtoseg,(int)); ! 527: dclproto(extern void inputInit,(int)); ! 528: dclproto(extern void inputstring,(char *)); ! 529: dclproto(extern void fillbuf,(void)); ! 530: dclproto(extern void nextline,(void)); ! 531: extern unsigned char *cp; ! 532: extern char *file; ! 533: extern char *firstfile; ! 534: extern unsigned char *limit; ! 535: extern char *line; ! 536: extern int lineno; ! 537: dclproto(extern int getchr,(void)); ! 538: dclproto(extern int gettok,(void)); ! 539: extern char kind[]; ! 540: extern Coordinate src; ! 541: #ifdef __STDC__ ! 542: extern enum tokencode t; ! 543: #else ! 544: extern int t; ! 545: #endif ! 546: extern char *token; ! 547: extern Symbol tsym; ! 548: dclproto(extern int main,(int, char **)); ! 549: dclproto(extern Symbol mkstr,(char *)); ! 550: dclproto(extern Symbol mksymbol,(int, char *,Type)); ! 551: extern int Aflag; ! 552: extern int Pflag; ! 553: extern Symbol YYnull; ! 554: /*G*/extern int glevel; ! 555: extern int xref; ! 556: dclproto(void bbinit,(char *)); ! 557: extern int ncalled; ! 558: extern int npoints; ! 559: dclproto(void traceinit,(char *)); ! 560: typedef struct { ! 561: List entry; ! 562: List exit; ! 563: List returns; ! 564: List points; ! 565: List calls; ! 566: List end; ! 567: } Events; ! 568: extern Events events; ! 569: dclproto(typedef void (*Apply),(Generic, Generic, Generic)); ! 570: dclproto(extern void attach,(Apply, Generic, List *)); ! 571: dclproto(extern void apply,(List, Generic, Generic)); ! 572: /*G*/dclproto(extern void fprint,(int, char *, ...)); ! 573: /*G*/dclproto(extern void print,(char *, ...)); ! 574: /*G*/dclproto(extern char *stringf,(char *, ...)); ! 575: /*G*/dclproto(extern void outflush,(void)); ! 576: dclproto(extern void outputInit,(int)); ! 577: /*G*/dclproto(extern void outs,(char *)); ! 578: dclproto(extern void vfprint,(int, char *, va_list)); ! 579: dclproto(extern void vprint,(char *, va_list)); ! 580: /*G*/extern char *bp; ! 581: dclproto(extern void error,(char *, ...)); ! 582: /*G*/dclproto(extern int fatal,(char *, char *, int)); ! 583: dclproto(extern void warning,(char *, ...)); ! 584: dclproto(extern int expect,(int)); ! 585: dclproto(extern void skipto,(int, char *)); ! 586: dclproto(extern void test,(int, char *)); ! 587: extern int errcnt; ! 588: extern int errlimit; ! 589: extern int wflag; ! 590: dclproto(extern int process,(char *)); ! 591: dclproto(extern int findfunc,(char *, char *)); ! 592: dclproto(extern int findcount,(char *, int, int)); ! 593: dclproto(extern Tree asgnnode,(int, Tree, Tree)); ! 594: dclproto(extern Tree bitnode,(int, Tree, Tree)); ! 595: dclproto(extern Tree callnode,(Tree, Type, Tree)); ! 596: dclproto(extern Tree condnode,(Tree, Tree, Tree)); ! 597: dclproto(extern Tree constnode,(unsigned int, Type)); ! 598: dclproto(extern Tree eqnode,(int, Tree, Tree)); ! 599: dclproto(extern Tree shnode,(int, Tree, Tree)); ! 600: dclproto(extern void typeerror,(int, Tree, Tree)); ! 601: dclproto(extern Tree (*opnode[]),(int, Tree, Tree)); ! 602: dclproto(extern Tree simplify,(int, Type, Tree, Tree)); ! 603: dclproto(extern int ispow2,(unsigned u)); ! 604: dclproto(extern char *vtoa,(Type, Value)); ! 605: extern int needconst; ! 606: dclproto(extern void definelab,(int)); ! 607: dclproto(extern Code definept,(Coordinate *)); ! 608: dclproto(extern void equatelab,(Symbol, Symbol)); ! 609: dclproto(extern void flushequ,(void)); ! 610: dclproto(extern void retcode,(Tree, int)); ! 611: dclproto(extern void statement,(int, Swtch, int)); ! 612: extern float density; ! 613: extern float refinc; ! 614: /*G*/dclproto(extern char *allocate,(int, Arena *)); ! 615: dclproto(extern void deallocate,(Arena *)); ! 616: /*G*/extern Arena permanent; ! 617: /*G*/extern Arena transient; ! 618: dclproto(extern void typeInit,(void)); ! 619: dclproto(extern Type array,(Type, int, int)); ! 620: dclproto(extern Type atop,(Type)); ! 621: dclproto(extern void checkfields,(Type)); ! 622: dclproto(extern Type composite,(Type, Type)); ! 623: dclproto(extern Symbol deftype,(char *, Type, Coordinate *)); ! 624: dclproto(extern Type deref,(Type)); ! 625: dclproto(extern int eqtype,(Type, Type, int)); ! 626: dclproto(extern Field extends,(Type, Type)); ! 627: /*G*/dclproto(extern Field fieldlist,(Type)); ! 628: dclproto(extern Field fieldref,(char *, Type)); ! 629: /*G*/dclproto(extern Type freturn,(Type)); ! 630: dclproto(extern Type func,(Type, Type *, int)); ! 631: dclproto(extern int hasproto,(Type)); ! 632: dclproto(extern Field newfield,(char *, Type, Type)); ! 633: dclproto(extern Type newstruct,(int, char *)); ! 634: dclproto(extern void outtype,(Type)); ! 635: dclproto(extern void printdecl,(Symbol, Type)); ! 636: dclproto(extern void printproto,(Symbol, Symbol *)); ! 637: dclproto(extern void printtype,(Type, int)); ! 638: dclproto(extern Type ptr,(Type)); ! 639: dclproto(extern Type qual,(int, Type)); ! 640: dclproto(extern void rmtypes,(void)); ! 641: /*G*/dclproto(extern int ttob,(Type)); ! 642: dclproto(extern char *typestring,(Type, char *)); ! 643: /*G*/dclproto(extern int variadic,(Type)); ! 644: /*G*/extern Type chartype; ! 645: extern Type doubletype; ! 646: extern Type floattype; ! 647: /*G*/extern Type inttype; ! 648: extern Type longdouble; ! 649: extern Type longtype; ! 650: extern Type shorttype; ! 651: extern Type signedchar; ! 652: /*G*/extern Type unsignedchar; ! 653: extern Type unsignedlong; ! 654: /*G*/extern Type unsignedshort; ! 655: extern Type unsignedtype; ! 656: extern Type voidptype; ! 657: extern Type voidtype; ! 658: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.