118334Speter/* Structure for saving state for a nested function.
290075Sobrien   Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3169689Skan   1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
418334Speter
590075SobrienThis file is part of GCC.
618334Speter
790075SobrienGCC is free software; you can redistribute it and/or modify it under
890075Sobrienthe terms of the GNU General Public License as published by the Free
990075SobrienSoftware Foundation; either version 2, or (at your option) any later
1090075Sobrienversion.
1118334Speter
1290075SobrienGCC is distributed in the hope that it will be useful, but WITHOUT ANY
1390075SobrienWARRANTY; without even the implied warranty of MERCHANTABILITY or
1490075SobrienFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1590075Sobrienfor more details.
1618334Speter
1718334SpeterYou should have received a copy of the GNU General Public License
1890075Sobrienalong with GCC; see the file COPYING.  If not, write to the Free
19169689SkanSoftware Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20169689Skan02110-1301, USA.  */
2118334Speter
22132718Skan#ifndef GCC_FUNCTION_H
23132718Skan#define GCC_FUNCTION_H
24132718Skan
25169689Skan#include "tree.h"
26169689Skan#include "hashtab.h"
27169689Skan
28117395Skanstruct var_refs_queue GTY(())
2918334Speter{
3018334Speter  rtx modified;
3118334Speter  enum machine_mode promoted_mode;
3218334Speter  int unsignedp;
3318334Speter  struct var_refs_queue *next;
3418334Speter};
3518334Speter
3618334Speter/* Stack of pending (incomplete) sequences saved by `start_sequence'.
3718334Speter   Each element describes one pending sequence.
3818334Speter   The main insn-chain is saved in the last element of the chain,
3918334Speter   unless the chain is empty.  */
4018334Speter
41117395Skanstruct sequence_stack GTY(())
4218334Speter{
4318334Speter  /* First and last insns in the chain of the saved sequence.  */
44117395Skan  rtx first;
45117395Skan  rtx last;
4618334Speter  struct sequence_stack *next;
4718334Speter};
4818334Speter
4918334Speterextern struct sequence_stack *sequence_stack;
5018334Speter
5118334Speter/* Stack of single obstacks.  */
5218334Speter
5318334Speterstruct simple_obstack_stack
5418334Speter{
5518334Speter  struct obstack *obstack;
5618334Speter  struct simple_obstack_stack *next;
5718334Speter};
5818334Speter
59117395Skanstruct emit_status GTY(())
6090075Sobrien{
6190075Sobrien  /* This is reset to LAST_VIRTUAL_REGISTER + 1 at the start of each function.
6290075Sobrien     After rtl generation, it is 1 plus the largest register number used.  */
6390075Sobrien  int x_reg_rtx_no;
6490075Sobrien
6590075Sobrien  /* Lowest label number in current function.  */
6690075Sobrien  int x_first_label_num;
6790075Sobrien
6890075Sobrien  /* The ends of the doubly-linked chain of rtl for the current function.
6990075Sobrien     Both are reset to null at the start of rtl generation for the function.
70132718Skan
71169689Skan     start_sequence saves both of these on `sequence_stack' and then starts
72169689Skan     a new, nested sequence of insns.  */
7390075Sobrien  rtx x_first_insn;
7490075Sobrien  rtx x_last_insn;
7590075Sobrien
7690075Sobrien  /* Stack of pending (incomplete) sequences saved by `start_sequence'.
7790075Sobrien     Each element describes one pending sequence.
7890075Sobrien     The main insn-chain is saved in the last element of the chain,
7990075Sobrien     unless the chain is empty.  */
8090075Sobrien  struct sequence_stack *sequence_stack;
8190075Sobrien
8290075Sobrien  /* INSN_UID for next insn emitted.
8390075Sobrien     Reset to 1 for each function compiled.  */
8490075Sobrien  int x_cur_insn_uid;
8590075Sobrien
86132718Skan  /* Location the last line-number NOTE emitted.
8790075Sobrien     This is used to avoid generating duplicates.  */
88132718Skan  location_t x_last_location;
8990075Sobrien
9090075Sobrien  /* The length of the regno_pointer_align, regno_decl, and x_regno_reg_rtx
9190075Sobrien     vectors.  Since these vectors are needed during the expansion phase when
9290075Sobrien     the total number of registers in the function is not yet known, the
9390075Sobrien     vectors are copied and made bigger when necessary.  */
9490075Sobrien  int regno_pointer_align_length;
9590075Sobrien
9690075Sobrien  /* Indexed by pseudo register number, if nonzero gives the known alignment
9790075Sobrien     for that pseudo (if REG_POINTER is set in x_regno_reg_rtx).
9890075Sobrien     Allocated in parallel with x_regno_reg_rtx.  */
99132718Skan  unsigned char * GTY ((length ("%h.x_reg_rtx_no")))
100117395Skan    regno_pointer_align;
10190075Sobrien
10290075Sobrien  /* Indexed by pseudo register number, gives the rtx for that pseudo.
103169689Skan     Allocated in parallel with regno_pointer_align.  */
104132718Skan  rtx * GTY ((length ("%h.x_reg_rtx_no"))) x_regno_reg_rtx;
10590075Sobrien};
10690075Sobrien
10790075Sobrien/* For backward compatibility... eventually these should all go away.  */
10890075Sobrien#define reg_rtx_no (cfun->emit->x_reg_rtx_no)
10990075Sobrien#define regno_reg_rtx (cfun->emit->x_regno_reg_rtx)
11090075Sobrien#define seq_stack (cfun->emit->sequence_stack)
11190075Sobrien
11290075Sobrien#define REGNO_POINTER_ALIGN(REGNO) (cfun->emit->regno_pointer_align[REGNO])
11390075Sobrien
114117395Skanstruct expr_status GTY(())
11590075Sobrien{
11690075Sobrien  /* Number of units that we should eventually pop off the stack.
11790075Sobrien     These are the arguments to function calls that have already returned.  */
11890075Sobrien  int x_pending_stack_adjust;
11990075Sobrien
12090075Sobrien  /* Under some ABIs, it is the caller's responsibility to pop arguments
12190075Sobrien     pushed for function calls.  A naive implementation would simply pop
12290075Sobrien     the arguments immediately after each call.  However, if several
12390075Sobrien     function calls are made in a row, it is typically cheaper to pop
12490075Sobrien     all the arguments after all of the calls are complete since a
12590075Sobrien     single pop instruction can be used.  Therefore, GCC attempts to
12690075Sobrien     defer popping the arguments until absolutely necessary.  (For
12790075Sobrien     example, at the end of a conditional, the arguments must be popped,
12890075Sobrien     since code outside the conditional won't know whether or not the
12990075Sobrien     arguments need to be popped.)
13090075Sobrien
131117395Skan     When INHIBIT_DEFER_POP is nonzero, however, the compiler does not
13290075Sobrien     attempt to defer pops.  Instead, the stack is popped immediately
13390075Sobrien     after each call.  Rather then setting this variable directly, use
13490075Sobrien     NO_DEFER_POP and OK_DEFER_POP.  */
13590075Sobrien  int x_inhibit_defer_pop;
13690075Sobrien
13790075Sobrien  /* If PREFERRED_STACK_BOUNDARY and PUSH_ROUNDING are defined, the stack
138117395Skan     boundary can be momentarily unaligned while pushing the arguments.
13990075Sobrien     Record the delta since last aligned boundary here in order to get
14090075Sobrien     stack alignment in the nested function calls working right.  */
14190075Sobrien  int x_stack_pointer_delta;
14290075Sobrien
14390075Sobrien  /* Nonzero means __builtin_saveregs has already been done in this function.
14490075Sobrien     The value is the pseudoreg containing the value __builtin_saveregs
14590075Sobrien     returned.  */
14690075Sobrien  rtx x_saveregs_value;
14790075Sobrien
14890075Sobrien  /* Similarly for __builtin_apply_args.  */
14990075Sobrien  rtx x_apply_args_value;
15090075Sobrien
15190075Sobrien  /* List of labels that must never be deleted.  */
15290075Sobrien  rtx x_forced_labels;
15390075Sobrien};
15490075Sobrien
15590075Sobrien#define pending_stack_adjust (cfun->expr->x_pending_stack_adjust)
15690075Sobrien#define inhibit_defer_pop (cfun->expr->x_inhibit_defer_pop)
15790075Sobrien#define saveregs_value (cfun->expr->x_saveregs_value)
15890075Sobrien#define apply_args_value (cfun->expr->x_apply_args_value)
15990075Sobrien#define forced_labels (cfun->expr->x_forced_labels)
16090075Sobrien#define stack_pointer_delta (cfun->expr->x_stack_pointer_delta)
16190075Sobrien
162169689Skanstruct temp_slot;
163169689Skantypedef struct temp_slot *temp_slot_p;
164169689Skan
165169689SkanDEF_VEC_P(temp_slot_p);
166169689SkanDEF_VEC_ALLOC_P(temp_slot_p,gc);
167169689Skan
168169689Skanenum function_frequency {
169169689Skan  /* This function most likely won't be executed at all.
170169689Skan     (set only when profile feedback is available).  */
171169689Skan  FUNCTION_FREQUENCY_UNLIKELY_EXECUTED,
172169689Skan  /* The default value.  */
173169689Skan  FUNCTION_FREQUENCY_NORMAL,
174169689Skan  /* Optimize this function hard
175169689Skan     (set only when profile feedback is available).  */
176169689Skan  FUNCTION_FREQUENCY_HOT
177169689Skan};
178169689Skan
17918334Speter/* This structure can save all the important global and static variables
18018334Speter   describing the status of the current function.  */
18118334Speter
182117395Skanstruct function GTY(())
18318334Speter{
18490075Sobrien  struct eh_status *eh;
18590075Sobrien  struct expr_status *expr;
18690075Sobrien  struct emit_status *emit;
18790075Sobrien  struct varasm_status *varasm;
18818334Speter
189169689Skan  /* The control flow graph for this function.  */
190169689Skan  struct control_flow_graph *cfg;
191169689Skan
19218334Speter  /* For function.c.  */
19390075Sobrien
19490075Sobrien  /* Points to the FUNCTION_DECL of this function.  */
19518334Speter  tree decl;
19690075Sobrien
19790075Sobrien  /* Function containing this function, if any.  */
19890075Sobrien  struct function *outer;
19990075Sobrien
20090075Sobrien  /* Number of bytes of args popped by function being compiled on its return.
20190075Sobrien     Zero if no bytes are to be popped.
20290075Sobrien     May affect compilation of return insn or of function epilogue.  */
20318334Speter  int pops_args;
20490075Sobrien
20590075Sobrien  /* If function's args have a fixed size, this is that size, in bytes.
20690075Sobrien     Otherwise, it is -1.
20790075Sobrien     May affect compilation of return insn or of function epilogue.  */
20818334Speter  int args_size;
20990075Sobrien
21090075Sobrien  /* # bytes the prologue should push and pretend that the caller pushed them.
21190075Sobrien     The prologue must do this, but only if parms can be passed in
21290075Sobrien     registers.  */
21318334Speter  int pretend_args_size;
21490075Sobrien
21590075Sobrien  /* # of bytes of outgoing arguments.  If ACCUMULATE_OUTGOING_ARGS is
21690075Sobrien     defined, the needed space is pushed by the prologue.  */
21790075Sobrien  int outgoing_args_size;
21890075Sobrien
21990075Sobrien  /* This is the offset from the arg pointer to the place where the first
22090075Sobrien     anonymous arg can be found, if there is one.  */
22118334Speter  rtx arg_offset_rtx;
22290075Sobrien
22390075Sobrien  /* Quantities of various kinds of registers
22490075Sobrien     used for the current function's args.  */
22590075Sobrien  CUMULATIVE_ARGS args_info;
22690075Sobrien
227117395Skan  /* If nonzero, an RTL expression for the location at which the current
22890075Sobrien     function returns its result.  If the current function returns its
22990075Sobrien     result in a register, current_function_return_rtx will always be
23090075Sobrien     the hard register containing the result.  */
23118334Speter  rtx return_rtx;
23290075Sobrien
23390075Sobrien  /* The arg pointer hard register, or the pseudo into which it was copied.  */
23418334Speter  rtx internal_arg_pointer;
23518334Speter
23690075Sobrien  /* Opaque pointer used by get_hard_reg_initial_val and
23790075Sobrien     has_hard_reg_initial_val (see integrate.[hc]).  */
23890075Sobrien  struct initial_value_struct *hard_reg_initial_vals;
23950397Sobrien
24090075Sobrien  /* List (chain of EXPR_LIST) of labels heading the current handlers for
24190075Sobrien     nonlocal gotos.  */
24290075Sobrien  rtx x_nonlocal_goto_handler_labels;
24318334Speter
24490075Sobrien  /* Label that will go on function epilogue.
24590075Sobrien     Jumping to this label serves as a "return" instruction
24690075Sobrien     on machines which require execution of the epilogue on all returns.  */
24790075Sobrien  rtx x_return_label;
24890075Sobrien
249132718Skan  /* Label that will go on the end of function epilogue.
250132718Skan     Jumping to this label serves as a "naked return" instruction
251132718Skan     on machines which require execution of the epilogue on all returns.  */
252132718Skan  rtx x_naked_return_label;
253132718Skan
25490075Sobrien  /* List (chain of EXPR_LISTs) of all stack slots in this function.
25590075Sobrien     Made for the sake of unshare_all_rtl.  */
25690075Sobrien  rtx x_stack_slot_list;
25790075Sobrien
25890075Sobrien  /* Place after which to insert the tail_recursion_label if we need one.  */
259169689Skan  rtx x_stack_check_probe_note;
26090075Sobrien
26190075Sobrien  /* Location at which to save the argument pointer if it will need to be
26290075Sobrien     referenced.  There are two cases where this is done: if nonlocal gotos
26390075Sobrien     exist, or if vars stored at an offset from the argument pointer will be
26490075Sobrien     needed by inner routines.  */
26590075Sobrien  rtx x_arg_pointer_save_area;
26690075Sobrien
26790075Sobrien  /* Offset to end of allocated area of stack frame.
26890075Sobrien     If stack grows down, this is the address of the last stack slot allocated.
26990075Sobrien     If stack grows up, this is the address for the next slot.  */
27090075Sobrien  HOST_WIDE_INT x_frame_offset;
27190075Sobrien
272169689Skan  /* A PARM_DECL that should contain the static chain for this function.
273169689Skan     It will be initialized at the beginning of the function.  */
274169689Skan  tree static_chain_decl;
27590075Sobrien
276169689Skan  /* An expression that contains the non-local goto save area.  The first
277169689Skan     word is the saved frame pointer and the second is the saved stack
278169689Skan     pointer.  */
279169689Skan  tree nonlocal_goto_save_area;
28090075Sobrien
28190075Sobrien  /* Insn after which register parms and SAVE_EXPRs are born, if nonopt.  */
28290075Sobrien  rtx x_parm_birth_insn;
28390075Sobrien
284169689Skan  /* List of all used temporaries allocated, by level.  */
285169689Skan  VEC(temp_slot_p,gc) *x_used_temp_slots;
28690075Sobrien
287169689Skan  /* List of available temp slots.  */
288169689Skan  struct temp_slot *x_avail_temp_slots;
28990075Sobrien
290169689Skan  /* This slot is initialized as 0 and is added to
291169689Skan     during the nested function.  */
292169689Skan  struct var_refs_queue *fixup_var_refs_queue;
29390075Sobrien
29490075Sobrien  /* Current nesting level for temporaries.  */
29590075Sobrien  int x_temp_slot_level;
29690075Sobrien
29790075Sobrien  /* Highest label number in current function.  */
29890075Sobrien  int inl_max_label_num;
29918334Speter
300117395Skan  /* Function sequence number for profiling, debugging, etc.  */
301117395Skan  int funcdef_no;
30296263Sobrien
303169689Skan  /* For flow.c.  */
304169689Skan
305169689Skan  /* Highest loop depth seen so far in loop analysis.  Used in flow.c
306169689Skan     for the "failure strategy" when doing liveness analysis starting
307169689Skan     with non-empty initial sets.  */
308169689Skan  int max_loop_depth;
309169689Skan
31018334Speter  /* For md files.  */
31190075Sobrien
31218334Speter  /* tm.h can use this to store whatever it likes.  */
313169689Skan  struct machine_function * GTY ((maybe_undef)) machine;
314169689Skan
31590075Sobrien  /* The largest alignment of slot allocated on the stack.  */
316169689Skan  unsigned int stack_alignment_needed;
317169689Skan
31890075Sobrien  /* Preferred alignment of the end of stack frame.  */
319169689Skan  unsigned int preferred_stack_boundary;
32018334Speter
32190075Sobrien  /* Language-specific code can use this to store whatever it likes.  */
322117395Skan  struct language_function * language;
32390075Sobrien
324169689Skan  /* Used types hash table.  */
325169689Skan  htab_t GTY ((param_is (union tree_node))) used_types_hash;
326169689Skan
32718334Speter  /* For reorg.  */
32890075Sobrien
32990075Sobrien  /* If some insns can be deferred to the delay slots of the epilogue, the
33090075Sobrien     delay list for them is recorded here.  */
33118334Speter  rtx epilogue_delay_list;
33218334Speter
333132718Skan  /* Maximal number of entities in the single jumptable.  Used to estimate
334132718Skan     final flowgraph size.  */
335132718Skan  int max_jumptable_ents;
336132718Skan
337169689Skan  /* UIDs for LABEL_DECLs.  */
338169689Skan  int last_label_uid;
339169689Skan
340169689Skan  /* Line number of the end of the function.  */
341169689Skan  location_t function_end_locus;
342169689Skan
343169689Skan  /* Array mapping insn uids to blocks.  */
344169689Skan  VEC(tree,gc) *ib_boundaries_block;
345169689Skan
346169689Skan  /* The variables unexpanded so far.  */
347169689Skan  tree unexpanded_var_list;
348169689Skan
349169689Skan  /* Assembly labels for the hot and cold text sections, to
350169689Skan     be used by debugger functions for determining the size of text
351169689Skan     sections.  */
352169689Skan
353169689Skan  const char *hot_section_label;
354169689Skan  const char *cold_section_label;
355169689Skan  const char *hot_section_end_label;
356169689Skan  const char *cold_section_end_label;
357169689Skan
358169689Skan  /* String to be used for name of cold text sections, via
359169689Skan     targetm.asm_out.named_section.  */
360169689Skan
361169689Skan  const char *unlikely_text_section_name;
362169689Skan
363169689Skan  /* A variable living at the top of the frame that holds a known value.
364169689Skan     Used for detecting stack clobbers.  */
365169689Skan  tree stack_protect_guard;
366169689Skan
36790075Sobrien  /* Collected bit flags.  */
36818334Speter
36990075Sobrien  /* Nonzero if function being compiled needs to be given an address
37090075Sobrien     where the value should be stored.  */
37190075Sobrien  unsigned int returns_struct : 1;
37218334Speter
37390075Sobrien  /* Nonzero if function being compiled needs to
37490075Sobrien     return the address of where it has put a structure value.  */
37590075Sobrien  unsigned int returns_pcc_struct : 1;
376132718Skan
37790075Sobrien  /* Nonzero if the current function returns a pointer type.  */
37890075Sobrien  unsigned int returns_pointer : 1;
37952284Sobrien
38090075Sobrien  /* Nonzero if function being compiled can call setjmp.  */
38190075Sobrien  unsigned int calls_setjmp : 1;
38252284Sobrien
38390075Sobrien  /* Nonzero if function being compiled can call alloca,
38490075Sobrien     either as a subroutine or builtin.  */
38590075Sobrien  unsigned int calls_alloca : 1;
38618334Speter
387169689Skan  /* Nonzero if function being compiled called builtin_return_addr or
388169689Skan     builtin_frame_address with nonzero count.  */
389169689Skan  unsigned int accesses_prior_frames : 1;
390169689Skan
39190075Sobrien  /* Nonzero if the function calls __builtin_eh_return.  */
39290075Sobrien  unsigned int calls_eh_return : 1;
39352284Sobrien
39490075Sobrien  /* Nonzero if function being compiled receives nonlocal gotos
39590075Sobrien     from nested functions.  */
39690075Sobrien  unsigned int has_nonlocal_label : 1;
39752284Sobrien
39890075Sobrien  /* Nonzero if function being compiled has nonlocal gotos to parent
39990075Sobrien     function.  */
40090075Sobrien  unsigned int has_nonlocal_goto : 1;
40152284Sobrien
402132718Skan  /* Nonzero if the current function is a thunk, i.e., a lightweight
403132718Skan     function implemented by the output_mi_thunk hook) that just
404132718Skan     adjusts one of its arguments and forwards to another
405132718Skan     function.  */
40690075Sobrien  unsigned int is_thunk : 1;
40752284Sobrien
408117395Skan  /* This bit is used by the exception handling logic.  It is set if all
409117395Skan     calls (if any) are sibling calls.  Such functions do not have to
410117395Skan     have EH tables generated, as they cannot throw.  A call to such a
411117395Skan     function, however, should be treated as throwing if any of its callees
412117395Skan     can throw.  */
413117395Skan  unsigned int all_throwers_are_sibcalls : 1;
414132718Skan
41590075Sobrien  /* Nonzero if profiling code should be generated.  */
41690075Sobrien  unsigned int profile : 1;
41790075Sobrien
41890075Sobrien  /* Nonzero if stack limit checking should be enabled in the current
41990075Sobrien     function.  */
42090075Sobrien  unsigned int limit_stack : 1;
42190075Sobrien
422117395Skan  /* Nonzero if current function uses stdarg.h or equivalent.  */
42390075Sobrien  unsigned int stdarg : 1;
42490075Sobrien
42590075Sobrien  /* Nonzero if the back-end should not keep track of expressions that
42690075Sobrien     determine the size of variable-sized objects.  Normally, such
42790075Sobrien     expressions are saved away, and then expanded when the next
42890075Sobrien     function is started.  For example, if a parameter has a
42990075Sobrien     variable-sized type, then the size of the parameter is computed
43090075Sobrien     when the function body is entered.  However, some front-ends do
43190075Sobrien     not desire this behavior.  */
43290075Sobrien  unsigned int x_dont_save_pending_sizes_p : 1;
43390075Sobrien
43490075Sobrien  /* Nonzero if the current function uses the constant pool.  */
43590075Sobrien  unsigned int uses_const_pool : 1;
43690075Sobrien
43790075Sobrien  /* Nonzero if the current function uses pic_offset_table_rtx.  */
43890075Sobrien  unsigned int uses_pic_offset_table : 1;
43990075Sobrien
44090075Sobrien  /* Nonzero if the current function needs an lsda for exception handling.  */
44190075Sobrien  unsigned int uses_eh_lsda : 1;
44290075Sobrien
443132718Skan  /* Nonzero if code to initialize arg_pointer_save_area has been emitted.  */
44490075Sobrien  unsigned int arg_pointer_save_area_init : 1;
445117395Skan
446169689Skan  unsigned int after_inlining : 1;
447117395Skan
448169689Skan  /* Set when the call to function itself has been emit.  */
449169689Skan  unsigned int recursive_call_emit : 1;
450169689Skan
451169689Skan  /* Set when the tail call has been produced.  */
452169689Skan  unsigned int tail_call_emit : 1;
453169689Skan
454169689Skan  /* How commonly executed the function is.  Initialized during branch
455169689Skan     probabilities pass.  */
456169689Skan  ENUM_BITFIELD (function_frequency) function_frequency : 2;
457169689Skan
458169689Skan  /* Number of units of general registers that need saving in stdarg
459169689Skan     function.  What unit is depends on the backend, either it is number
460169689Skan     of bytes, or it can be number of registers.  */
461169689Skan  unsigned int va_list_gpr_size : 8;
462169689Skan
463169689Skan  /* Number of units of floating point registers that need saving in stdarg
464169689Skan     function.  */
465169689Skan  unsigned int va_list_fpr_size : 8;
46690075Sobrien};
46790075Sobrien
468169689Skan/* If va_list_[gf]pr_size is set to this, it means we don't know how
469169689Skan   many units need to be saved.  */
470169689Skan#define VA_LIST_MAX_GPR_SIZE	255
471169689Skan#define VA_LIST_MAX_FPR_SIZE	255
472169689Skan
47390075Sobrien/* The function currently being compiled.  */
474117395Skanextern GTY(()) struct function *cfun;
47590075Sobrien
476132718Skan/* Pointer to chain of `struct function' for containing functions.  */
477132718Skanextern GTY(()) struct function *outer_function_chain;
478132718Skan
47990075Sobrien/* Nonzero if we've already converted virtual regs to hard regs.  */
48090075Sobrienextern int virtuals_instantiated;
48190075Sobrien
482132718Skan/* Nonzero if at least one trampoline has been created.  */
483132718Skanextern int trampolines_created;
484132718Skan
48590075Sobrien/* For backward compatibility... eventually these should all go away.  */
48690075Sobrien#define current_function_pops_args (cfun->pops_args)
48790075Sobrien#define current_function_returns_struct (cfun->returns_struct)
48890075Sobrien#define current_function_returns_pcc_struct (cfun->returns_pcc_struct)
48990075Sobrien#define current_function_returns_pointer (cfun->returns_pointer)
49090075Sobrien#define current_function_calls_setjmp (cfun->calls_setjmp)
49190075Sobrien#define current_function_calls_alloca (cfun->calls_alloca)
492169689Skan#define current_function_accesses_prior_frames (cfun->accesses_prior_frames)
49390075Sobrien#define current_function_calls_eh_return (cfun->calls_eh_return)
49490075Sobrien#define current_function_is_thunk (cfun->is_thunk)
49590075Sobrien#define current_function_args_info (cfun->args_info)
49690075Sobrien#define current_function_args_size (cfun->args_size)
49790075Sobrien#define current_function_pretend_args_size (cfun->pretend_args_size)
49890075Sobrien#define current_function_outgoing_args_size (cfun->outgoing_args_size)
49990075Sobrien#define current_function_arg_offset_rtx (cfun->arg_offset_rtx)
50090075Sobrien#define current_function_stdarg (cfun->stdarg)
50190075Sobrien#define current_function_internal_arg_pointer (cfun->internal_arg_pointer)
50290075Sobrien#define current_function_return_rtx (cfun->return_rtx)
50390075Sobrien#define current_function_profile (cfun->profile)
504117395Skan#define current_function_funcdef_no (cfun->funcdef_no)
50590075Sobrien#define current_function_limit_stack (cfun->limit_stack)
50690075Sobrien#define current_function_uses_pic_offset_table (cfun->uses_pic_offset_table)
50790075Sobrien#define current_function_uses_const_pool (cfun->uses_const_pool)
50890075Sobrien#define current_function_epilogue_delay_list (cfun->epilogue_delay_list)
50990075Sobrien#define current_function_has_nonlocal_label (cfun->has_nonlocal_label)
51090075Sobrien#define current_function_has_nonlocal_goto (cfun->has_nonlocal_goto)
51190075Sobrien
51290075Sobrien#define return_label (cfun->x_return_label)
513132718Skan#define naked_return_label (cfun->x_naked_return_label)
51490075Sobrien#define stack_slot_list (cfun->x_stack_slot_list)
51590075Sobrien#define parm_birth_insn (cfun->x_parm_birth_insn)
51690075Sobrien#define frame_offset (cfun->x_frame_offset)
517169689Skan#define stack_check_probe_note (cfun->x_stack_check_probe_note)
51890075Sobrien#define arg_pointer_save_area (cfun->x_arg_pointer_save_area)
519169689Skan#define used_temp_slots (cfun->x_used_temp_slots)
520169689Skan#define avail_temp_slots (cfun->x_avail_temp_slots)
52190075Sobrien#define temp_slot_level (cfun->x_temp_slot_level)
52290075Sobrien#define nonlocal_goto_handler_labels (cfun->x_nonlocal_goto_handler_labels)
52390075Sobrien
52418334Speter/* Given a function decl for a containing function,
52518334Speter   return the `struct function' for it.  */
526132718Skanstruct function *find_function_data (tree);
52718334Speter
52890075Sobrien/* Identify BLOCKs referenced by more than one NOTE_INSN_BLOCK_{BEG,END},
52990075Sobrien   and create duplicate blocks.  */
530132718Skanextern void reorder_blocks (void);
53118334Speter
53290075Sobrien/* Set BLOCK_NUMBER for all the blocks in FN.  */
533132718Skanextern void number_blocks (tree);
53490075Sobrien
535169689Skanextern void clear_block_marks (tree);
536169689Skanextern tree blocks_nreverse (tree);
537169689Skanextern void reset_block_changes (void);
538169689Skanextern void record_block_change (tree);
539169689Skanextern void finalize_block_changes (void);
540169689Skanextern void check_block_change (rtx, tree *);
541169689Skanextern void free_block_changes (void);
542169689Skan
54350397Sobrien/* Return size needed for stack frame based on slots so far allocated.
54450397Sobrien   This size counts from zero.  It is not rounded to STACK_BOUNDARY;
54550397Sobrien   the caller may have to do that.  */
546132718Skanextern HOST_WIDE_INT get_frame_size (void);
54750397Sobrien
548169689Skan/* Issue an error message and return TRUE if frame OFFSET overflows in
549169689Skan   the signed target pointer arithmetics for function FUNC.  Otherwise
550169689Skan   return FALSE.  */
551169689Skanextern bool frame_offset_overflow (HOST_WIDE_INT, tree);
552169689Skan
553117395Skan/* A pointer to a function to create target specific, per-function
554117395Skan   data structures.  */
555132718Skanextern struct machine_function * (*init_machine_status) (void);
55618334Speter
55750397Sobrien/* Save and restore status information for a nested function.  */
558132718Skanextern void free_after_parsing (struct function *);
559132718Skanextern void free_after_compilation (struct function *);
56018334Speter
561132718Skanextern void init_varasm_status (struct function *);
56250397Sobrien
56390075Sobrien#ifdef RTX_CODE
564132718Skanextern void diddle_return_value (void (*)(rtx, void*), void*);
565132718Skanextern void clobber_return_register (void);
56618334Speter#endif
56718334Speter
568132718Skanextern rtx get_arg_pointer_save_area (struct function *);
56990075Sobrien
570132718Skan/* Returns the name of the current function.  */
571132718Skanextern const char *current_function_name (void);
572132718Skan
573132718Skanextern void do_warn_unused_parameter (tree);
574132718Skan
575169689Skanextern bool pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
576169689Skan			       tree, bool);
577169689Skanextern bool reference_callee_copied (CUMULATIVE_ARGS *, enum machine_mode,
578169689Skan				     tree, bool);
579169689Skan
580169689Skanextern void used_types_insert (tree);
581169689Skan
582132718Skan#endif  /* GCC_FUNCTION_H */
583