1 /* Structure for saving state for a nested function.
2 Copyright (C) 1989, 92-97, 1998 Free Software Foundation, Inc.
4 This file is part of GNU CC.
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)
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.
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. */
22 #if !defined(NULL_TREE) && !defined(tree)
23 typedef union union_node *_function_tree;
24 #define tree _function_tree
26 #if !defined(NULL_RTX) && !defined(rtx)
27 typedef struct rtx_def *_function_rtx;
28 #define rtx _function_rtx
34 enum machine_mode promoted_mode;
36 struct var_refs_queue *next;
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. */
46 /* First and last insns in the chain of the saved sequence. */
48 tree sequence_rtl_expr;
49 struct sequence_stack *next;
52 extern struct sequence_stack *sequence_stack;
54 /* Stack of single obstacks. */
56 struct simple_obstack_stack
58 struct obstack *obstack;
59 struct simple_obstack_stack *next;
62 /* This structure can save all the important global and static variables
63 describing the status of the current function. */
67 struct function *next;
74 int returns_pcc_struct;
80 int has_nonlocal_label;
81 int has_nonlocal_goto;
82 int contains_functions;
84 rtx nonlocal_goto_handler_slots;
85 rtx nonlocal_goto_stack_level;
88 int pretend_args_size;
93 rtx *parm_reg_stack_loc;
94 int outgoing_args_size;
101 HOST_WIDE_INT frame_offset;
102 rtx tail_recursion_label;
103 rtx tail_recursion_reentry;
104 rtx internal_arg_pointer;
106 rtx arg_pointer_save_area;
109 tree context_display;
110 tree trampoline_list;
111 int function_call_count;
112 struct temp_slot *temp_slots;
114 int target_temp_slot_level;
115 int var_temp_slot_level;
116 int instrument_entry_exit;
117 /* This slot is initialized as 0 and is added to
118 during the nested function. */
119 struct var_refs_queue *fixup_var_refs_queue;
120 CUMULATIVE_ARGS args_info;
123 struct nesting *block_stack;
124 struct nesting *stack_block_stack;
125 struct nesting *cond_stack;
126 struct nesting *loop_stack;
127 struct nesting *case_stack;
128 struct nesting *nesting_stack;
130 int block_start_count;
133 int expr_stmts_for_value;
136 struct goto_fixup *goto_fixup_chain;
138 /* For exception handling information. */
139 struct eh_stack ehstack;
140 struct eh_stack catchstack;
141 struct eh_queue ehqueue;
143 struct label_node *false_label_stack;
144 struct label_node *caught_return_label_stack;
150 int pending_stack_adjust;
151 int inhibit_defer_pop;
153 rtx apply_args_value;
155 int check_memory_usage;
157 /* For emit-rtl.c. */
162 tree sequence_rtl_expr;
163 struct sequence_stack *sequence_stack;
167 char *regno_pointer_flag;
168 char *regno_pointer_align;
169 int regno_pointer_flag_length;
172 /* For stor-layout.c. */
173 tree permanent_type_chain;
174 tree temporary_type_chain;
175 tree permanent_type_end;
176 tree temporary_type_end;
178 int immediate_size_expand;
181 int all_types_permanent;
182 struct momentary_level *momentary_stack;
183 char *maybepermanent_firstobj;
184 char *temporary_firstobj;
185 char *momentary_firstobj;
186 char *momentary_function_firstobj;
187 struct obstack *current_obstack;
188 struct obstack *function_obstack;
189 struct obstack *function_maybepermanent_obstack;
190 struct obstack *expression_obstack;
191 struct obstack *saveable_obstack;
192 struct obstack *rtl_obstack;
193 struct simple_obstack_stack *inline_obstacks;
195 /* For integrate.c. */
199 int uses_pic_offset_table;
200 /* tm.h can use this to store whatever it likes. */
201 struct machine_function *machine;
204 rtx epilogue_delay_list;
207 struct constant_descriptor **const_rtx_hash_table;
208 struct pool_sym **const_rtx_sym_hash_table;
209 struct pool_constant *first_pool, *last_pool;
211 rtx const_double_chain;
214 /* The FUNCTION_DECL for an inline function currently being expanded. */
215 extern tree inline_function_decl;
217 /* Label that will go on function epilogue.
218 Jumping to this label serves as a "return" instruction
219 on machines which require execution of the epilogue on all returns. */
220 extern rtx return_label;
222 /* List (chain of EXPR_LISTs) of all stack slots in this function.
223 Made for the sake of unshare_all_rtl. */
224 extern rtx stack_slot_list;
226 /* Given a function decl for a containing function,
227 return the `struct function' for it. */
228 struct function *find_function_data PROTO((tree));
230 /* Pointer to chain of `struct function' for containing functions. */
231 extern struct function *outer_function_chain;
233 /* Put all this function's BLOCK nodes into a vector and return it.
234 Also store in each NOTE for the beginning or end of a block
235 the index of that block in the vector. */
236 extern tree *identify_blocks PROTO((tree, rtx));
238 /* Return size needed for stack frame based on slots so far allocated.
239 This size counts from zero. It is not rounded to STACK_BOUNDARY;
240 the caller may have to do that. */
241 extern HOST_WIDE_INT get_frame_size PROTO((void));
243 /* These variables hold pointers to functions to
244 save and restore machine-specific data,
245 in push_function_context and pop_function_context. */
246 extern void (*save_machine_status) PROTO((struct function *));
247 extern void (*restore_machine_status) PROTO((struct function *));
249 /* Save and restore status information for a nested function. */
250 extern void save_tree_status PROTO((struct function *, tree));
251 extern void restore_tree_status PROTO((struct function *, tree));
252 extern void save_varasm_status PROTO((struct function *, tree));
253 extern void restore_varasm_status PROTO((struct function *));
254 extern void save_eh_status PROTO((struct function *));
255 extern void restore_eh_status PROTO((struct function *));
256 extern void save_stmt_status PROTO((struct function *));
257 extern void restore_stmt_status PROTO((struct function *));
258 extern void save_expr_status PROTO((struct function *));
259 extern void restore_expr_status PROTO((struct function *));
260 extern void save_emit_status PROTO((struct function *));
261 extern void restore_emit_status PROTO((struct function *));
262 extern void save_storage_status PROTO((struct function *));
263 extern void restore_storage_status PROTO((struct function *));
265 extern rtx get_first_block_beg PROTO((void));