Make rtx, tree types type correct if the appropriate include files was not included
[gcc.git] / gcc / function.h
1 /* Structure for saving state for a nested function.
2 Copyright (C) 1989, 92-97, 1998 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21
22 #if !defined(NULL_TREE) && !defined(tree)
23 typedef union union_node *_function_tree;
24 #define tree _function_tree
25 #endif
26 #if !defined(NULL_RTX) && !defined(rtx)
27 typedef struct rtx_def *_function_rtx;
28 #define rtx _function_rtx
29 #endif
30
31 struct var_refs_queue
32 {
33 rtx modified;
34 enum machine_mode promoted_mode;
35 int unsignedp;
36 struct var_refs_queue *next;
37 };
38
39 /* Stack of pending (incomplete) sequences saved by `start_sequence'.
40 Each element describes one pending sequence.
41 The main insn-chain is saved in the last element of the chain,
42 unless the chain is empty. */
43
44 struct sequence_stack
45 {
46 /* First and last insns in the chain of the saved sequence. */
47 rtx first, last;
48 tree sequence_rtl_expr;
49 struct sequence_stack *next;
50 };
51
52 extern struct sequence_stack *sequence_stack;
53
54 /* Stack of single obstacks. */
55
56 struct simple_obstack_stack
57 {
58 struct obstack *obstack;
59 struct simple_obstack_stack *next;
60 };
61 \f
62 /* This structure can save all the important global and static variables
63 describing the status of the current function. */
64
65 struct function
66 {
67 struct function *next;
68
69 /* For function.c. */
70 char *name;
71 tree decl;
72 int pops_args;
73 int returns_struct;
74 int returns_pcc_struct;
75 int returns_pointer;
76 int needs_context;
77 int calls_setjmp;
78 int calls_longjmp;
79 int calls_alloca;
80 int has_nonlocal_label;
81 int has_nonlocal_goto;
82 int contains_functions;
83 int is_thunk;
84 rtx nonlocal_goto_handler_slot;
85 rtx nonlocal_goto_stack_level;
86 tree nonlocal_labels;
87 int args_size;
88 int pretend_args_size;
89 rtx arg_offset_rtx;
90 int varargs;
91 int stdarg;
92 int max_parm_reg;
93 rtx *parm_reg_stack_loc;
94 int outgoing_args_size;
95 rtx return_rtx;
96 rtx cleanup_label;
97 rtx return_label;
98 rtx save_expr_regs;
99 rtx stack_slot_list;
100 rtx parm_birth_insn;
101 HOST_WIDE_INT frame_offset;
102 rtx tail_recursion_label;
103 rtx tail_recursion_reentry;
104 rtx internal_arg_pointer;
105 rtx arg_pointer_save_area;
106 tree rtl_expr_chain;
107 rtx last_parm_insn;
108 tree context_display;
109 tree trampoline_list;
110 int function_call_count;
111 struct temp_slot *temp_slots;
112 int temp_slot_level;
113 int target_temp_slot_level;
114 int var_temp_slot_level;
115 /* This slot is initialized as 0 and is added to
116 during the nested function. */
117 struct var_refs_queue *fixup_var_refs_queue;
118 CUMULATIVE_ARGS args_info;
119
120 /* For stmt.c */
121 struct nesting *block_stack;
122 struct nesting *stack_block_stack;
123 struct nesting *cond_stack;
124 struct nesting *loop_stack;
125 struct nesting *case_stack;
126 struct nesting *nesting_stack;
127 int nesting_depth;
128 int block_start_count;
129 tree last_expr_type;
130 rtx last_expr_value;
131 int expr_stmts_for_value;
132 char *emit_filename;
133 int emit_lineno;
134 struct goto_fixup *goto_fixup_chain;
135
136 /* For exception handling information. */
137 struct eh_stack ehstack;
138 struct eh_stack catchstack;
139 struct eh_queue ehqueue;
140 rtx catch_clauses;
141 struct label_node *false_label_stack;
142 struct label_node *caught_return_label_stack;
143 tree protect_list;
144 rtx ehc;
145
146 /* For expr.c. */
147 int pending_stack_adjust;
148 int inhibit_defer_pop;
149 rtx saveregs_value;
150 rtx apply_args_value;
151 rtx forced_labels;
152
153 /* For emit-rtl.c. */
154 int reg_rtx_no;
155 int first_label_num;
156 rtx first_insn;
157 rtx last_insn;
158 tree sequence_rtl_expr;
159 struct sequence_stack *sequence_stack;
160 int cur_insn_uid;
161 int last_linenum;
162 char *last_filename;
163 char *regno_pointer_flag;
164 char *regno_pointer_align;
165 int regno_pointer_flag_length;
166 rtx *regno_reg_rtx;
167
168 /* For stor-layout.c. */
169 tree permanent_type_chain;
170 tree temporary_type_chain;
171 tree permanent_type_end;
172 tree temporary_type_end;
173 tree pending_sizes;
174 int immediate_size_expand;
175
176 /* For tree.c. */
177 int all_types_permanent;
178 struct momentary_level *momentary_stack;
179 char *maybepermanent_firstobj;
180 char *temporary_firstobj;
181 char *momentary_firstobj;
182 char *momentary_function_firstobj;
183 struct obstack *current_obstack;
184 struct obstack *function_obstack;
185 struct obstack *function_maybepermanent_obstack;
186 struct obstack *expression_obstack;
187 struct obstack *saveable_obstack;
188 struct obstack *rtl_obstack;
189 struct simple_obstack_stack *inline_obstacks;
190
191 /* For integrate.c. */
192 int uses_const_pool;
193
194 /* For md files. */
195 int uses_pic_offset_table;
196 /* tm.h can use this to store whatever it likes. */
197 struct machine_function *machine;
198
199 /* For reorg. */
200 rtx epilogue_delay_list;
201
202 /* For varasm. */
203 struct constant_descriptor **const_rtx_hash_table;
204 struct pool_sym **const_rtx_sym_hash_table;
205 struct pool_constant *first_pool, *last_pool;
206 int pool_offset;
207 rtx const_double_chain;
208 };
209
210 /* The FUNCTION_DECL for an inline function currently being expanded. */
211 extern tree inline_function_decl;
212
213 /* Label that will go on function epilogue.
214 Jumping to this label serves as a "return" instruction
215 on machines which require execution of the epilogue on all returns. */
216 extern rtx return_label;
217
218 /* List (chain of EXPR_LISTs) of all stack slots in this function.
219 Made for the sake of unshare_all_rtl. */
220 extern rtx stack_slot_list;
221
222 /* Given a function decl for a containing function,
223 return the `struct function' for it. */
224 struct function *find_function_data PROTO((tree));
225
226 /* Pointer to chain of `struct function' for containing functions. */
227 extern struct function *outer_function_chain;
228
229 /* Put all this function's BLOCK nodes into a vector and return it.
230 Also store in each NOTE for the beginning or end of a block
231 the index of that block in the vector. */
232 extern tree *identify_blocks PROTO((tree, rtx));
233
234 /* Return size needed for stack frame based on slots so far allocated.
235 This size counts from zero. It is not rounded to STACK_BOUNDARY;
236 the caller may have to do that. */
237 extern HOST_WIDE_INT get_frame_size PROTO((void));
238
239 /* These variables hold pointers to functions to
240 save and restore machine-specific data,
241 in push_function_context and pop_function_context. */
242 extern void (*save_machine_status) PROTO((struct function *));
243 extern void (*restore_machine_status) PROTO((struct function *));
244
245 /* Save and restore status information for a nested function. */
246 extern void save_tree_status PROTO((struct function *, tree));
247 extern void restore_tree_status PROTO((struct function *, tree));
248 extern void save_varasm_status PROTO((struct function *, tree));
249 extern void restore_varasm_status PROTO((struct function *));
250 extern void save_eh_status PROTO((struct function *));
251 extern void restore_eh_status PROTO((struct function *));
252 extern void save_stmt_status PROTO((struct function *));
253 extern void restore_stmt_status PROTO((struct function *));
254 extern void save_expr_status PROTO((struct function *));
255 extern void restore_expr_status PROTO((struct function *));
256 extern void save_emit_status PROTO((struct function *));
257 extern void restore_emit_status PROTO((struct function *));
258 extern void save_storage_status PROTO((struct function *));
259 extern void restore_storage_status PROTO((struct function *));
260
261 #ifdef rtx
262 #undef rtx
263 #endif
264
265 #ifdef tree
266 #undef tree
267 #endif