1 /* $Id: cs.h,v 1.4 1994/06/24 10:21:43 ceriel Exp $ */
3 * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
4 * See the copyright notice in the ACK home directory, in the file "Copyright".
7 typedef struct entity *entity_p;
8 typedef struct avail *avail_p;
9 typedef struct token *token_p;
10 typedef struct occur *occur_p;
15 line_p tk_lfirst; /* Textually first instruction, involved
16 * in pushing this token.
20 /* We distinguish these entities. */
28 #define ENAOFFSETTED 7
41 byte en_kind; /* ENLOCAL, ENEXTERNAL, etc. */
44 offset en__val; /* ENCONST. */
45 offset en__loc; /* ENLOCAL, ENALOCAL. */
46 obj_p en__ext; /* ENEXTERNAL, ENAEXTERNAL. */
47 valnum en__ind; /* ENINDIR. */
51 } en_offs; /* ENOFFSETTED, ENAOFFSETTED. */
52 offset en__levels; /* ENALOCBASE, ENAARGBASE. */
53 proc_p en__pro; /* ENPROC. */
58 } en_arr; /* ENARRELEM. */
62 /* Macros to increase ease of use. */
63 #define en_val en_inf.en__val
64 #define en_loc en_inf.en__loc
65 #define en_ext en_inf.en__ext
66 #define en_ind en_inf.en__ind
67 #define en_base en_inf.en_offs.en__base
68 #define en_off en_inf.en_offs.en__off
69 #define en_levels en_inf.en__levels
70 #define en_pro en_inf.en__pro
71 #define en_arbase en_inf.en_arr.en__arbase
72 #define en_index en_inf.en_arr.en__index
73 #define en_adesc en_inf.en_arr.en__adesc
76 line_p oc_lfirst; /* First instruction of expression. */
77 line_p oc_llast; /* Last one. */
78 bblock_p oc_belongs; /* Basic block it belongs to. */
81 /* We distinguish these groups of instructions. */
83 #define EXPENSIVE_LOAD 1
85 #define STORE_DIRECT 3
92 #define SIDE_EFFECTS 10
93 #define FIDDLE_STACK 11
99 avail_p av_before; /* Ptr to earlier discovered expressions. */
100 byte av_instr; /* Operator instruction. */
102 line_p av_found; /* Line where expression is first found. */
103 lset av_occurs; /* Set of recurrences of expression. */
104 entity_p av_saveloc; /* Local where result is put in. */
107 valnum av__operand; /* EXPENSIVE_LOAD, UNAIR_OP. */
111 } av_2; /* BINAIR_OP. */
116 } av_3; /* TERNAIR_OP. */
120 /* Macros to increase ease of use. */
121 #define av_operand av_o.av__operand
122 #define av_oleft av_o.av_2.av__oleft
123 #define av_oright av_o.av_2.av__oright
124 #define av_ofirst av_o.av_3.av__ofirst
125 #define av_osecond av_o.av_3.av__osecond
126 #define av_othird av_o.av_3.av__othird
128 extern int Scs; /* Number of optimizations found. */