OSDN Git Service

e8b32e80e41d082729b0afc623e153dd22655025
[pf3gnuchains/gcc-fork.git] / gcc / function.h
1 /* Structure for saving state for a nested function.
2    Copyright (C) 1989, 1992, 1993, 1994 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, 675 Mass Ave, Cambridge, MA 02139, USA.  */
19
20
21 #ifndef NULL_TREE
22 #define tree int *
23 #endif
24 #ifndef GET_CODE
25 #define rtx int *
26 #endif
27
28 struct var_refs_queue
29 {
30   rtx modified;
31   enum machine_mode promoted_mode;
32   int unsignedp;
33   struct var_refs_queue *next;
34 };
35
36 /* Stack of pending (incomplete) sequences saved by `start_sequence'.
37    Each element describes one pending sequence.
38    The main insn-chain is saved in the last element of the chain,
39    unless the chain is empty.  */
40
41 struct sequence_stack
42 {
43   /* First and last insns in the chain of the saved sequence.  */
44   rtx first, last;
45   tree sequence_rtl_expr;
46   struct sequence_stack *next;
47 };
48
49 extern struct sequence_stack *sequence_stack;
50
51 /* Stack of single obstacks.  */
52
53 struct simple_obstack_stack
54 {
55   struct obstack *obstack;
56   struct simple_obstack_stack *next;
57 };
58 \f
59 /* This structure can save all the important global and static variables
60    describing the status of the current function.  */
61
62 struct function
63 {
64   struct function *next;
65
66   /* For function.c.  */
67   char *name;
68   tree decl;
69   int pops_args;
70   int returns_struct;
71   int returns_pcc_struct;
72   int needs_context;
73   int calls_setjmp;
74   int calls_longjmp;
75   int calls_alloca;
76   int has_nonlocal_label;
77   int has_nonlocal_goto;
78   int contains_functions;
79   rtx nonlocal_goto_handler_slot;
80   rtx nonlocal_goto_stack_level;
81   tree nonlocal_labels;
82   int args_size;
83   int pretend_args_size;
84   rtx arg_offset_rtx;
85   int varargs;
86   int max_parm_reg;
87   rtx *parm_reg_stack_loc;
88   int outgoing_args_size;
89   rtx return_rtx;
90   rtx cleanup_label;
91   rtx return_label;
92   rtx save_expr_regs;
93   rtx stack_slot_list;
94   rtx parm_birth_insn;
95   int frame_offset;
96   rtx tail_recursion_label;
97   rtx tail_recursion_reentry;
98   rtx internal_arg_pointer;
99   rtx arg_pointer_save_area;
100   tree rtl_expr_chain;
101   rtx last_parm_insn;
102   tree context_display;
103   tree trampoline_list;
104   int function_call_count;
105   struct temp_slot *temp_slots;
106   int temp_slot_level;
107   /* This slot is initialized as 0 and is added to
108      during the nested function.  */
109   struct var_refs_queue *fixup_var_refs_queue;
110
111   /* For stmt.c  */
112   struct nesting *block_stack;
113   struct nesting *stack_block_stack;
114   struct nesting *cond_stack;
115   struct nesting *loop_stack;
116   struct nesting *case_stack;
117   struct nesting *nesting_stack;
118   int nesting_depth;
119   int block_start_count;
120   tree last_expr_type;
121   rtx last_expr_value;
122   int expr_stmts_for_value;
123   char *emit_filename;
124   int emit_lineno;
125   struct goto_fixup *goto_fixup_chain;
126
127   /* For expr.c.  */
128   int pending_stack_adjust;
129   int inhibit_defer_pop;
130   tree cleanups_this_call;
131   rtx saveregs_value;
132   rtx apply_args_value;
133   rtx forced_labels;
134
135   /* For emit-rtl.c.  */
136   int reg_rtx_no;
137   int first_label_num;
138   rtx first_insn;
139   rtx last_insn;
140   tree sequence_rtl_expr;
141   struct sequence_stack *sequence_stack;
142   int cur_insn_uid;
143   int last_linenum;
144   char *last_filename;
145   char *regno_pointer_flag;
146   int regno_pointer_flag_length;
147   rtx *regno_reg_rtx;
148
149   /* For stor-layout.c.  */
150   tree permanent_type_chain;
151   tree temporary_type_chain;
152   tree permanent_type_end;
153   tree temporary_type_end;
154   tree pending_sizes;
155   int immediate_size_expand;
156
157   /* For tree.c.  */
158   int all_types_permanent;
159   struct momentary_level *momentary_stack;
160   char *maybepermanent_firstobj;
161   char *temporary_firstobj;
162   char *momentary_firstobj;
163   char *momentary_function_firstobj;
164   struct obstack *current_obstack;
165   struct obstack *function_obstack;
166   struct obstack *function_maybepermanent_obstack;
167   struct obstack *expression_obstack;
168   struct obstack *saveable_obstack;
169   struct obstack *rtl_obstack;
170   struct simple_obstack_stack *inline_obstacks;
171
172   /* For integrate.c.  */
173   int uses_const_pool;
174
175   /* For md files.  */
176   int uses_pic_offset_table;
177   /* tm.h can use this to store whatever it likes.  */
178   struct machine_function *machine;
179
180   /* For reorg.  */
181   rtx epilogue_delay_list;
182
183   /* For varasm.  */
184   struct constant_descriptor **const_rtx_hash_table;
185   struct pool_sym **const_rtx_sym_hash_table;
186   struct pool_constant *first_pool, *last_pool;
187   int pool_offset;
188 };
189
190 /* The FUNCTION_DECL for an inline function currently being expanded.  */
191 extern tree inline_function_decl;
192
193 /* Label that will go on function epilogue.
194    Jumping to this label serves as a "return" instruction
195    on machines which require execution of the epilogue on all returns.  */
196 extern rtx return_label;
197
198 /* List (chain of EXPR_LISTs) of all stack slots in this function.
199    Made for the sake of unshare_all_rtl.  */
200 extern rtx stack_slot_list;
201
202 /* Given a function decl for a containing function,
203    return the `struct function' for it.  */
204 struct function *find_function_data PROTO((tree));
205
206 /* Pointer to chain of `struct function' for containing functions.  */
207 extern struct function *outer_function_chain;
208
209 /* Put all this function's BLOCK nodes into a vector and return it.
210    Also store in each NOTE for the beginning or end of a block
211    the index of that block in the vector.  */
212 extern tree *identify_blocks PROTO((tree, rtx));
213
214 /* These variables hold pointers to functions to
215    save and restore machine-specific data,
216    in push_function_context and pop_function_context.  */
217 extern void (*save_machine_status) ();
218 extern void (*restore_machine_status) ();
219
220 /* Save and restore varasm.c status for a nested function.  */
221 extern void save_varasm_status          PROTO((struct function *));
222 extern void restore_varasm_status       PROTO((struct function *));
223
224 #ifdef rtx
225 #undef rtx
226 #endif
227
228 #ifdef tree
229 #undef tree
230 #endif