1 /* Id: pass1.h,v 1.291 2016/02/09 17:57:35 ragge Exp */ 2 /* $NetBSD: pass1.h,v 1.5 2016/02/09 20:37:32 plunky Exp $ */ 3 /* 4 * Copyright(C) Caldera International Inc. 2001-2002. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 10 * Redistributions of source code and documentation must retain the above 11 * copyright notice, this list of conditions and the following disclaimer. 12 * Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditionsand the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * All advertising materials mentioning features or use of this software 16 * must display the following acknowledgement: 17 * This product includes software developed or owned by Caldera 18 * International, Inc. 19 * Neither the name of Caldera International, Inc. nor the names of other 20 * contributors may be used to endorse or promote products derived from 21 * this software without specific prior written permission. 22 * 23 * USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA 24 * INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR 25 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 * DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE 28 * FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, 32 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 33 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * POSSIBILITY OF SUCH DAMAGE. 35 */ 36 37 #include "config.h" 38 39 #include <sys/types.h> 40 #include <stdarg.h> 41 #include <string.h> 42 #ifdef HAVE_STDINT_H 43 #include <stdint.h> 44 #endif 45 #include <stdlib.h> 46 47 #ifndef MKEXT 48 #include "external.h" 49 #else 50 typedef unsigned int bittype; /* XXX - for basicblock */ 51 #endif 52 #include "manifest.h" 53 #include "softfloat.h" 54 55 /* 56 * Storage classes 57 */ 58 #define SNULL 0 59 #define AUTO 1 60 #define EXTERN 2 61 #define STATIC 3 62 #define REGISTER 4 63 #define EXTDEF 5 64 #define THLOCAL 6 65 #define KEYWORD 7 66 #define MOS 8 67 #define PARAM 9 68 #define STNAME 10 69 #define MOU 11 70 #define UNAME 12 71 #define TYPEDEF 13 72 /* #define FORTRAN 14 */ 73 #define ENAME 15 74 #define MOE 16 75 /* #define UFORTRAN 17 */ 76 #define USTATIC 18 77 78 /* field size is ORed in */ 79 #define FIELD 0200 80 #define FLDSIZ 0177 81 extern char *scnames(int); 82 83 /* 84 * Symbol table flags 85 */ 86 #define SNORMAL 0 87 #define STAGNAME 01 88 #define SLBLNAME 02 89 #define SMOSNAME 03 90 #define SSTRING 04 91 #define NSTYPES 05 92 #define SMASK 07 93 94 #define STLS 00010 /* Thread Local Support variable */ 95 #define SINSYS 00020 /* Declared in system header */ 96 #define SSTMT SINSYS /* Allocate symtab on statement stack */ 97 #define SNOCREAT 00040 /* don't create a symbol in lookup() */ 98 #define STEMP 00100 /* Allocate symtab from temp or perm mem */ 99 #define SDYNARRAY 00200 /* symbol is dynamic array on stack */ 100 #define SINLINE 00400 /* function is of type inline */ 101 #define SBLK SINLINE /* Allocate symtab from blk mem */ 102 #define STNODE 01000 /* symbol shall be a temporary node */ 103 #define SBUILTIN 02000 /* this is a builtin function */ 104 #define SASG 04000 /* symbol is assigned to already */ 105 #define SLOCAL1 010000 106 #define SLOCAL2 020000 107 #define SLOCAL3 040000 108 109 /* alignment of initialized quantities */ 110 #ifndef AL_INIT 111 #define AL_INIT ALINT 112 #endif 113 114 struct rstack; 115 struct symtab; 116 union arglist; 117 #ifdef GCC_COMPAT 118 struct gcc_attr_pack; 119 #endif 120 121 /* 122 * Dimension/prototype information. 123 * ddim > 0 holds the dimension of an array. 124 * ddim < 0 is a dynamic array and refers to a tempnode. 125 * ...unless: 126 * ddim == NOOFFSET, an array without dimenston, "[]" 127 * ddim == -1, dynamic array while building before defid. 128 */ 129 union dimfun { 130 int ddim; /* Dimension of an array */ 131 union arglist *dfun; /* Prototype index */ 132 }; 133 134 /* 135 * Argument list member info when storing prototypes. 136 */ 137 union arglist { 138 TWORD type; 139 union dimfun *df; 140 struct attr *sap; 141 }; 142 #define TNULL INCREF(FARG) /* pointer to FARG -- impossible type */ 143 #define TELLIPSIS INCREF(INCREF(FARG)) 144 145 /* 146 * Symbol table definition. 147 */ 148 struct symtab { 149 struct symtab *snext; /* link to other symbols in the same scope */ 150 int soffset; /* offset or value */ 151 char sclass; /* storage class */ 152 char slevel; /* scope level */ 153 short sflags; /* flags, see below */ 154 char *sname; /* Symbol name */ 155 TWORD stype; /* type word */ 156 TWORD squal; /* qualifier word */ 157 union dimfun *sdf; /* ptr to the dimension/prototype array */ 158 struct attr *sap; /* the base type attribute list */ 159 }; 160 161 #define ISSOU(ty) ((ty) == STRTY || (ty) == UNIONTY) 162 163 /* 164 * External definitions 165 */ 166 struct swents { /* switch table */ 167 struct swents *next; /* Next struct in linked list */ 168 CONSZ sval; /* case value */ 169 int slab; /* associated label */ 170 }; 171 int mygenswitch(int, TWORD, struct swents **, int); 172 173 extern int blevel; 174 extern int oldstyle; 175 176 extern int lineno, nerrors, issyshdr; 177 178 extern char *ftitle; 179 extern struct symtab *cftnsp; 180 extern int autooff, maxautooff, argoff; 181 182 extern OFFSZ inoff; 183 184 extern int reached; 185 extern int isinlining; 186 extern int xinline, xgnu89, xgnu99; 187 extern int bdebug, ddebug, edebug, idebug, ndebug; 188 extern int odebug, pdebug, sdebug, tdebug, xdebug; 189 190 /* various labels */ 191 extern int brklab; 192 extern int contlab; 193 extern int flostat; 194 extern int retlab; 195 extern int doing_init, statinit; 196 extern short sztable[]; 197 extern char *astypnames[]; 198 199 /* pragma globals */ 200 extern int pragma_allpacked, pragma_packed, pragma_aligned; 201 202 /* 203 * Flags used in the (elementary) flow analysis ... 204 */ 205 #define FBRK 02 206 #define FCONT 04 207 #define FDEF 010 208 #define FLOOP 020 209 210 /* 211 * Location counters 212 */ 213 #define NOSEG -1 214 #define PROG 0 /* (ro) program segment */ 215 #define DATA 1 /* (rw) data segment */ 216 #define RDATA 2 /* (ro) data segment */ 217 #define LDATA 3 /* (rw) local data */ 218 #define UDATA 4 /* (rw) uninitialized data */ 219 #define STRNG 5 /* (ro) string segment */ 220 #define PICDATA 6 /* (rw) relocatable data segment */ 221 #define PICRDATA 7 /* (ro) relocatable data segment */ 222 #define PICLDATA 8 /* (rw) local relocatable data */ 223 #define TLSDATA 9 /* (rw) TLS data segment */ 224 #define TLSUDATA 10 /* (rw) TLS uninitialized segment */ 225 #define CTORS 11 /* constructor */ 226 #define DTORS 12 /* destructor */ 227 #define NMSEG 13 /* other (named) segment */ 228 229 extern int lastloc; 230 void locctr(int type, struct symtab *sp); 231 void setseg(int type, char *name); 232 void defalign(int al); 233 void symdirec(struct symtab *sp); 234 235 /* 236 * Tree struct for pass1. 237 */ 238 typedef struct p1node { 239 int n_op; 240 TWORD n_type; 241 TWORD n_qual; 242 union { 243 char * _name; 244 union dimfun *_df; 245 } n_5; 246 struct attr *n_ap; 247 union { 248 struct { 249 union { 250 struct p1node *_left; 251 CONSZ _val; 252 } n_l; 253 union { 254 struct p1node *_right; 255 int _rval; 256 struct symtab *_sp; 257 } n_r; 258 } n_u; 259 struct { 260 union flt *_dcon; 261 union flt *_ccon; 262 }; 263 } n_f; 264 } P1ND; 265 266 #define glval(p) ((p)->n_f.n_u.n_l._val) 267 #define slval(p,v) ((p)->n_f.n_u.n_l._val = (v)) 268 #define n_ccon n_f._ccon 269 270 271 /* mark an offset which is undefined */ 272 273 #define NOOFFSET (-10201) 274 275 /* declarations of various functions */ 276 extern P1ND 277 *buildtree(int, P1ND *, P1ND *r), 278 *mkty(unsigned, union dimfun *, struct attr *), 279 *rstruct(char *, int), 280 *dclstruct(struct rstack *), 281 *strend(char *, TWORD), 282 *tymerge(P1ND *, P1ND *), 283 *stref(P1ND *), 284 #ifdef WORD_ADDRESSED 285 *offcon(OFFSZ, TWORD, union dimfun *, struct attr *), 286 #endif 287 *bcon(int), 288 *xbcon(CONSZ, struct symtab *, TWORD), 289 *bpsize(P1ND *), 290 *convert(P1ND *, int), 291 *pconvert(P1ND *), 292 *oconvert(P1ND *), 293 *ptmatch(P1ND *), 294 *makety(P1ND *, TWORD, TWORD, union dimfun *, struct attr *), 295 *block(int, P1ND *, P1ND *, TWORD, union dimfun *, struct attr *), 296 *doszof(P1ND *), 297 *p1alloc(void), 298 *optim(P1ND *), 299 *clocal(P1ND *), 300 *tempnode(int, TWORD, union dimfun *, struct attr *), 301 *eve(P1ND *), 302 *doacall(struct symtab *, P1ND *, P1ND *); 303 P1ND *intprom(P1ND *); 304 OFFSZ tsize(TWORD, union dimfun *, struct attr *), 305 psize(P1ND *); 306 P1ND * typenode(P1ND *new); 307 void spalloc(P1ND *, P1ND *, OFFSZ); 308 char *exname(char *); 309 union flt *floatcon(char *); 310 union flt *fhexcon(char *); 311 P1ND *bdty(int op, ...); 312 extern struct rstack *rpole; 313 314 int oalloc(struct symtab *, int *); 315 void deflabel(char *, P1ND *); 316 void gotolabel(char *); 317 unsigned int esccon(char **); 318 void inline_start(struct symtab *, int class); 319 void inline_end(void); 320 void inline_addarg(struct interpass *); 321 void inline_ref(struct symtab *); 322 void inline_prtout(void); 323 void inline_args(struct symtab **, int); 324 P1ND *inlinetree(struct symtab *, P1ND *, P1ND *); 325 void ftnarg(P1ND *); 326 struct rstack *bstruct(char *, int, P1ND *); 327 void moedef(char *); 328 void beginit(struct symtab *); 329 void simpleinit(struct symtab *, P1ND *); 330 struct symtab *lookup(char *, int); 331 struct symtab *getsymtab(char *, int); 332 char *addstring(char *); 333 char *addname(char *); 334 void symclear(int); 335 struct symtab *hide(struct symtab *); 336 void soumemb(P1ND *, char *, int); 337 int talign(unsigned int, struct attr *); 338 void bfcode(struct symtab **, int); 339 int chkftn(union arglist *, union arglist *); 340 void branch(int); 341 void cbranch(P1ND *, P1ND *); 342 void extdec(struct symtab *); 343 void defzero(struct symtab *); 344 int falloc(struct symtab *, int, P1ND *); 345 TWORD ctype(TWORD); 346 void inval(CONSZ, int, P1ND *); 347 int ninval(CONSZ, int, P1ND *); 348 void infld(CONSZ, int, CONSZ); 349 void zbits(CONSZ, int); 350 void instring(struct symtab *); 351 void inwstring(struct symtab *); 352 void plabel(int); 353 void bjobcode(void); 354 void ejobcode(int); 355 void calldec(P1ND *, P1ND *); 356 int cisreg(TWORD); 357 void asginit(P1ND *); 358 void desinit(P1ND *); 359 void endinit(int); 360 void endictx(void); 361 void sspinit(void); 362 void sspstart(void); 363 void sspend(void); 364 void ilbrace(void); 365 void irbrace(void); 366 CONSZ scalinit(P1ND *); 367 void p1print(char *, ...); 368 char *copst(int); 369 int cdope(int); 370 void myp2tree(P1ND *); 371 void lcommprint(void), strprint(void); 372 void lcommdel(struct symtab *); 373 P1ND *funcode(P1ND *); 374 struct symtab *enumhd(char *); 375 P1ND *enumdcl(struct symtab *); 376 P1ND *enumref(char *); 377 CONSZ icons(P1ND *); 378 CONSZ valcast(CONSZ v, TWORD t); 379 int mypragma(char *); 380 char *pragtok(char *); 381 int eat(int); 382 void fixdef(struct symtab *); 383 int cqual(TWORD, TWORD); 384 void defloc(struct symtab *); 385 int fldchk(int); 386 int nncon(P1ND *); 387 void cunput(char); 388 P1ND *nametree(struct symtab *sp); 389 void pass1_lastchance(struct interpass *); 390 void fldty(struct symtab *p); 391 struct suedef *sueget(struct suedef *p); 392 void complinit(void); 393 void kwinit(void); 394 P1ND *structref(P1ND *p, int f, char *name); 395 P1ND *cxop(int op, P1ND *l, P1ND *r); 396 P1ND *imop(int op, P1ND *l, P1ND *r); 397 P1ND *cxelem(int op, P1ND *p); 398 P1ND *cxconj(P1ND *p); 399 P1ND *cxcast(P1ND *p1, P1ND *p2); 400 P1ND *cxret(P1ND *p, P1ND *q); 401 P1ND *imret(P1ND *p, P1ND *q); 402 P1ND *cast(P1ND *p, TWORD t, TWORD q); 403 P1ND *ccast(P1ND *p, TWORD t, TWORD u, union dimfun *df, struct attr *sue); 404 int andable(P1ND *); 405 int conval(P1ND *, int, P1ND *); 406 int ispow2(CONSZ); 407 void defid(P1ND *q, int class); 408 void defid2(P1ND *q, int class, char *astr); 409 void efcode(void); 410 void ecomp(P1ND *p); 411 int upoff(int size, int alignment, int *poff); 412 void nidcl(P1ND *p, int class); 413 void nidcl2(P1ND *p, int class, char *astr); 414 void eprint(P1ND *, int, int *, int *); 415 int uclass(int class); 416 int notlval(P1ND *); 417 void ecode(P1ND *p); 418 void ftnend(void); 419 void dclargs(void); 420 int suemeq(struct attr *s1, struct attr *s2); 421 struct symtab *strmemb(struct attr *ap); 422 int yylex(void); 423 void yyerror(char *); 424 int pragmas_gcc(char *t); 425 int concast(P1ND *p, TWORD t); 426 char *stradd(char *old, char *new); 427 #ifdef WORD_ADDRESSED 428 #define rmpconv(p) (p) 429 #else 430 P1ND *rmpconv(P1ND *); 431 #endif 432 P1ND *optloop(P1ND *); 433 P1ND *nlabel(int label); 434 TWORD styp(void); 435 void *stmtalloc(size_t); 436 void *blkalloc(size_t); 437 void stmtfree(void); 438 void blkfree(void); 439 char *getexname(struct symtab *sp); 440 void putjops(P1ND *p, void *arg); 441 442 void p1walkf(P1ND *, void (*f)(P1ND *, void *), void *); 443 void p1fwalk(P1ND *t, void (*f)(P1ND *, int, int *, int *), int down); 444 void p1listf(P1ND *p, void (*f)(P1ND *)); 445 void p1flist(P1ND *p, void (*f)(P1ND *, void *), void *); 446 P1ND *p1nfree(P1ND *); 447 void p1tfree(P1ND *); 448 P1ND *p1tcopy(P1ND *); 449 450 enum { ATTR_FIRST = ATTR_MI_MAX + 1, 451 452 /* PCC used attributes */ 453 ATTR_COMPLEX, /* Internal definition of complex */ 454 xxxATTR_BASETYP, /* Internal; see below */ 455 ATTR_QUALTYP, /* Internal; const/volatile, see below */ 456 ATTR_ALIGNED, /* Internal; also used as gcc type attribute */ 457 ATTR_NORETURN, /* Function does not return */ 458 ATTR_STRUCT, /* Internal; element list */ 459 #define ATTR_MAX ATTR_STRUCT 460 461 ATTR_P1LABELS, /* used to store stuff while parsing */ 462 ATTR_SONAME, /* output name of symbol */ 463 464 #ifdef GCC_COMPAT 465 /* type attributes */ 466 GCC_ATYP_PACKED, 467 GCC_ATYP_SECTION, 468 GCC_ATYP_TRANSP_UNION, 469 GCC_ATYP_UNUSED, 470 GCC_ATYP_DEPRECATED, 471 GCC_ATYP_MAYALIAS, 472 473 /* variable attributes */ 474 GCC_ATYP_MODE, 475 476 /* function attributes */ 477 GCC_ATYP_FORMAT, 478 GCC_ATYP_NONNULL, 479 GCC_ATYP_SENTINEL, 480 GCC_ATYP_WEAK, 481 GCC_ATYP_FORMATARG, 482 GCC_ATYP_GNU_INLINE, 483 GCC_ATYP_MALLOC, 484 GCC_ATYP_NOTHROW, 485 GCC_ATYP_CONST, 486 GCC_ATYP_PURE, 487 GCC_ATYP_CONSTRUCTOR, 488 GCC_ATYP_DESTRUCTOR, 489 GCC_ATYP_VISIBILITY, 490 GCC_ATYP_WARN_UNUSED_RESULT, 491 GCC_ATYP_USED, 492 GCC_ATYP_NO_INSTR_FUN, 493 GCC_ATYP_NOINLINE, 494 GCC_ATYP_ALIAS, 495 GCC_ATYP_WEAKREF, 496 GCC_ATYP_ALLOCSZ, 497 GCC_ATYP_ALW_INL, 498 GCC_ATYP_TLSMODEL, 499 GCC_ATYP_ALIASWEAK, 500 GCC_ATYP_RETURNS_TWICE, 501 GCC_ATYP_WARNING, 502 GCC_ATYP_NOCLONE, 503 GCC_ATYP_REGPARM, 504 GCC_ATYP_FASTCALL, 505 506 /* other stuff */ 507 GCC_ATYP_BOUNDED, /* OpenBSD extra boundary checks */ 508 509 /* OSX toolchain */ 510 GCC_ATYP_WEAKIMPORT, 511 512 GCC_ATYP_MAX, 513 #endif 514 #ifdef ATTR_P1_TARGET 515 ATTR_P1_TARGET, 516 #endif 517 ATTR_P1_MAX 518 }; 519 520 /* 521 #ifdef notdef 522 * ATTR_BASETYP has the following layout: 523 * aa[0].iarg has size 524 * aa[1].iarg has alignment 525 #endif 526 * ATTR_QUALTYP has the following layout: 527 * aa[0].iarg has CON/VOL + FUN/ARY/PTR 528 * Not defined yet... 529 * aa[3].iarg is dimension for arrays (XXX future) 530 * aa[3].varg is function defs for functions. 531 */ 532 #ifdef notdef 533 #define atypsz aa[0].iarg 534 #define aalign aa[1].iarg 535 #endif 536 537 /* 538 * ATTR_STRUCT member list. 539 */ 540 #define amlist aa[0].varg 541 #define amsize aa[1].iarg 542 #define strattr(x) (attr_find(x, ATTR_STRUCT)) 543 544 void gcc_init(void); 545 int gcc_keyword(char *); 546 struct attr *gcc_attr_parse(P1ND *); 547 void gcc_tcattrfix(P1ND *); 548 struct gcc_attrib *gcc_get_attr(struct suedef *, int); 549 void dump_attr(struct attr *gap); 550 void gcc_modefix(P1ND *); 551 P1ND *gcc_eval_timode(int op, P1ND *, P1ND *); 552 P1ND *gcc_eval_ticast(int op, P1ND *, P1ND *); 553 P1ND *gcc_eval_tiuni(int op, P1ND *); 554 struct attr *isti(P1ND *p); 555 556 #ifndef NO_C_BUILTINS 557 struct bitable { 558 char *name; 559 P1ND *(*fun)(const struct bitable *, P1ND *a); 560 short flags; 561 #define BTNOPROTO 001 562 #define BTNORVAL 002 563 #define BTNOEVE 004 564 #define BTGNUONLY 010 565 short narg; 566 TWORD *tp; 567 TWORD rt; 568 }; 569 570 P1ND *builtin_check(struct symtab *, P1ND *a); 571 void builtin_init(void); 572 573 /* Some builtins targets need to implement */ 574 P1ND *builtin_frame_address(const struct bitable *bt, P1ND *a); 575 P1ND *builtin_return_address(const struct bitable *bt, P1ND *a); 576 P1ND *builtin_cfa(const struct bitable *bt, P1ND *a); 577 #endif 578 579 580 #ifdef STABS 581 void stabs_init(void); 582 void stabs_file(char *); 583 void stabs_efile(char *); 584 void stabs_line(int); 585 void stabs_rbrac(int); 586 void stabs_lbrac(int); 587 void stabs_func(struct symtab *); 588 void stabs_newsym(struct symtab *); 589 void stabs_chgsym(struct symtab *); 590 void stabs_struct(struct symtab *, struct attr *); 591 #endif 592 593 #ifndef CHARCAST 594 /* to make character constants into character connstants */ 595 /* this is a macro to defend against cross-compilers, etc. */ 596 #define CHARCAST(x) (char)(x) 597 #endif 598 599 /* sometimes int is smaller than pointers */ 600 #if SZPOINT(CHAR) <= SZINT 601 #define INTPTR INT 602 #elif SZPOINT(CHAR) <= SZLONG 603 #define INTPTR LONG 604 #elif SZPOINT(CHAR) <= SZLONGLONG 605 #define INTPTR LONGLONG 606 #else 607 #error int size unknown 608 #endif 609 610 /* Generate a bitmask from a given type size */ 611 #define SZMASK(y) ((((1LL << ((y)-1))-1) << 1) | 1) 612 613 /* 614 * finction specifiers. 615 */ 616 #define INLINE 1 617 #define NORETURN 2 618 619 /* 620 * C compiler first pass extra defines. 621 */ 622 #define QUALIFIER (MAXOP+1) 623 #define CLASS (MAXOP+2) 624 #define RB (MAXOP+3) 625 #define DOT (MAXOP+4) 626 #define ELLIPSIS (MAXOP+5) 627 #define TYPE (MAXOP+6) 628 #define LB (MAXOP+7) 629 #define COMOP (MAXOP+8) 630 #define QUEST (MAXOP+9) 631 #define COLON (MAXOP+10) 632 #define ANDAND (MAXOP+11) 633 #define OROR (MAXOP+12) 634 #define NOT (MAXOP+13) 635 #define CAST (MAXOP+14) 636 #define STRING (MAXOP+15) 637 638 /* The following must be in the same order as their NOASG counterparts */ 639 #define PLUSEQ (MAXOP+16) 640 #define MINUSEQ (MAXOP+17) 641 #define DIVEQ (MAXOP+18) 642 #define MODEQ (MAXOP+19) 643 #define MULEQ (MAXOP+20) 644 #define ANDEQ (MAXOP+21) 645 #define OREQ (MAXOP+22) 646 #define EREQ (MAXOP+23) 647 #define LSEQ (MAXOP+24) 648 #define RSEQ (MAXOP+25) 649 650 #define UNASG (-(PLUSEQ-PLUS))+ 651 652 #define INCR (MAXOP+26) 653 #define DECR (MAXOP+27) 654 #define SZOF (MAXOP+28) 655 #define CLOP (MAXOP+29) 656 #define ATTRIB (MAXOP+30) 657 #define XREAL (MAXOP+31) 658 #define XIMAG (MAXOP+32) 659 #define TYMERGE (MAXOP+33) 660 #define LABEL (MAXOP+34) 661 #define BIQUEST (MAXOP+35) 662 #define UPLUS (MAXOP+36) 663 #define ALIGN (MAXOP+37) 664 #define FUNSPEC (MAXOP+38) 665 #define STREF (MAXOP+39) 666 667 /* 668 * The following types are only used in pass1. 669 */ 670 #define SIGNED (MAXTYPES+1) 671 #define FARG (MAXTYPES+2) 672 #define FIMAG (MAXTYPES+3) 673 #define IMAG (MAXTYPES+4) 674 #define LIMAG (MAXTYPES+5) 675 #define FCOMPLEX (MAXTYPES+6) 676 #define COMPLEX (MAXTYPES+7) 677 #define LCOMPLEX (MAXTYPES+8) 678 #define ENUMTY (MAXTYPES+9) 679 680 #define ISFTY(x) ((x) >= FLOAT && (x) <= LDOUBLE) 681 #define ISCTY(x) ((x) >= FCOMPLEX && (x) <= LCOMPLEX) 682 #define ISITY(x) ((x) >= FIMAG && (x) <= LIMAG) 683 #define ANYCX(p) (p->n_type == STRTY && attr_find(p->n_ap, ATTR_COMPLEX)) 684 685 #define coptype(o) (cdope(o)&TYFLG) 686 #define clogop(o) (cdope(o)&LOGFLG) 687 #define casgop(o) (cdope(o)&ASGFLG) 688 689 #ifdef TWOPASS 690 #define PRTPREF "* " 691 #else 692 #define PRTPREF "" 693 #endif 694 695 /* 696 * Allocation routines. 697 */ 698 #if defined(__PCC__) || defined(__GNUC__) 699 #define FUNALLO(x) __builtin_alloca(x) 700 #define FUNFREE(x) 701 #elif defined(HAVE_ALLOCA) 702 #define FUNALLO(x) alloca(x) 703 #define FUNFREE(x) 704 #else 705 #define FUNALLO(x) malloc(x) 706 #define FUNFREE(x) free(x) 707 #endif 708