1999-12-20 Bernd Schmidt <bernds@cygnus.co.uk>
+ * function.c (cfun): Renamed from current_function. All users
+ changed.
+ * function.h (cfun): Rename declaration as well.
+
* reload.h (struct insn_chain): Change live_throughout and dead_or_set
to be of type regset_head, not regset. All users changed by adding
address operator.
if (count != 0)
return const0_rtx;
- reg = current_function->machine->ra_rtx;
+ reg = cfun->machine->ra_rtx;
if (reg == NULL)
{
/* No rtx yet. Invent one, and initialize it from $26 in
the prologue. */
reg = gen_reg_rtx (Pmode);
- current_function->machine->ra_rtx = reg;
+ cfun->machine->ra_rtx = reg;
init = gen_rtx_SET (VOIDmode, reg, gen_rtx_REG (Pmode, REG_RA));
/* Emit the insn to the prologue with the other argument copies. */
if (current_function_is_thunk)
return 0;
#endif
- if (!current_function->machine->ra_rtx)
+ if (!cfun->machine->ra_rtx)
return regs_ever_live[REG_RA];
push_topmost_sequence ();
fp_is_frame_pointer = ((TARGET_OPEN_VMS && vms_is_stack_procedure)
|| (!TARGET_OPEN_VMS && frame_pointer_needed));
- eh_ofs = current_function->machine->eh_epilogue_sp_ofs;
+ eh_ofs = cfun->machine->eh_epilogue_sp_ofs;
if (sa_size)
{
/* If we have a frame pointer, restore SP from it. */
"! TARGET_OPEN_VMS"
"
{
- current_function->machine->eh_epilogue_sp_ofs = operands[1];
+ cfun->machine->eh_epilogue_sp_ofs = operands[1];
if (GET_CODE (operands[2]) != REG || REGNO (operands[2]) != 26)
{
rtx ra = gen_rtx_REG (Pmode, 26);
rtx stack_locals[(int) MAX_MACHINE_MODE][MAX_386_STACK_LOCALS];
};
-#define ix86_stack_locals (current_function->machine->stack_locals)
+#define ix86_stack_locals (cfun->machine->stack_locals)
/* which cpu are we scheduling for */
enum processor_type ix86_cpu;
/* Check if the compiler has recorded some information
about the alignment of the base REG. If reload has
completed, we already matched with proper alignments. */
- if (((current_function != 0
- && REGNO_POINTER_ALIGN (regno) >= desired)
+ if (((cfun != 0 && REGNO_POINTER_ALIGN (regno) >= desired)
|| reload_completed)
&& ((INTVAL (offset) & (desired - 1)) == 0))
return 1;
/* The current C++-specific per-function global variables. */
-#define cp_function_chain (current_function->language)
+#define cp_function_chain (cfun->language)
/* In a destructor, the point at which all derived class destroying
has been done, just before any base class destroying will be done. */
expression for `*this'. */
#define current_class_ptr \
- (current_function ? cp_function_chain->x_current_class_ptr : NULL_TREE)
+ (cfun ? cp_function_chain->x_current_class_ptr : NULL_TREE)
#define current_class_ref \
- (current_function ? cp_function_chain->x_current_class_ref : NULL_TREE)
+ (cfun ? cp_function_chain->x_current_class_ref : NULL_TREE)
/* Information about the current statement tree. */
#define current_stmt_tree \
- (current_function \
+ (cfun \
? &cp_function_chain->x_stmt_tree \
: &scope_chain->x_stmt_tree)
/* The binding level currently in effect. */
#define current_binding_level \
- (current_function \
+ (cfun \
? cp_function_chain->bindings \
: scope_chain->bindings)
{
struct binding_level *newlevel;
- if (current_function && !doing_semantic_analysis_p ())
+ if (cfun && !doing_semantic_analysis_p ())
return;
/* Reuse or create a struct for this binding level. */
int block_previously_created;
int leaving_for_scope;
- if (current_function && !doing_semantic_analysis_p ())
+ if (cfun && !doing_semantic_analysis_p ())
return NULL_TREE;
my_friendly_assert (current_binding_level->parm_flag != 2,
/* Any uses of undefined labels now operate under constraints
of next binding contour. */
- if (current_function)
+ if (cfun)
{
struct binding_level *level_chain;
level_chain = current_binding_level->level_chain;
b = scope_chain ? current_binding_level : 0;
/* If we're in the middle of some function, save our state. */
- if (current_function)
+ if (cfun)
{
need_pop = 1;
push_function_context_to (NULL_TREE);
/* We shouldn't be calling pushdecl when we're generating RTL for a
function that we already did semantic analysis on previously. */
- my_friendly_assert (!current_function || doing_semantic_analysis_p (),
+ my_friendly_assert (!cfun || doing_semantic_analysis_p (),
19990913);
name = DECL_ASSEMBLER_NAME (x);
/* Handling __FUNCTION__ and its ilk in a template-function requires
some special processing because we are called from
language-independent code. */
- if (current_function && processing_template_decl
+ if (cfun && processing_template_decl
&& current_function_name_declared == 2)
{
/* Since we're in a template function, we need to
/* Initialize RTL machinery. We cannot do this until
CURRENT_FUNCTION_DECL and DECL_RESULT are set up. We do this
even when processing a template; this is how we get
- CURRENT_FUNCTION set up, and our per-function variables
- initialized. */
+ CFUN set up, and our per-function variables initialized. */
bl = current_binding_level;
init_function_start (decl1, input_filename, lineno);
current_binding_level = bl;
We haven't necessarily assigned RTL to all variables yet, so it's
not safe to try to expand expressions involving them. */
immediate_size_expand = 0;
- current_function->x_dont_save_pending_sizes_p = 1;
+ cfun->x_dont_save_pending_sizes_p = 1;
/* If we're building a statement-tree, start the tree now. */
if (processing_template_decl || !expanding_p)
/* Reset these in case the call to pushdecl changed them. */
current_function_decl = decl1;
- current_function->decl = decl1;
+ cfun->decl = decl1;
/* Initialize the per-function data. */
if (!DECL_PENDING_INLINE_P (decl1) && DECL_SAVED_FUNCTION_DATA (decl1))
/* This function is being processed in whole-function mode; we
already did semantic analysis. */
- current_function->x_whole_function_mode_p = 1;
+ cfun->x_whole_function_mode_p = 1;
/* If we decided that we didn't want to inline this function,
make sure the back-end knows that. */
else
{
/* Clear out memory we no longer need. */
- free_after_parsing (current_function);
+ free_after_parsing (cfun);
/* Since we never call rest_of_compilation, we never clear
- CURRENT_FUNCTION. Do so explicitly. */
- free_after_compilation (current_function);
- current_function = NULL;
+ CFUN. Do so explicitly. */
+ free_after_compilation (cfun);
+ cfun = NULL;
}
/* If this is a in-class inline definition, we may have to pop the
ASM_OUTPUT_MI_THUNK (asm_out_file, thunk_fndecl, delta, function);
assemble_end_function (thunk_fndecl, fnname);
current_function_decl = 0;
- current_function = 0;
+ cfun = 0;
}
#else /* ASM_OUTPUT_MI_THUNK */
{
/* If this is the outermost block of the function, declare the
variables __FUNCTION__, __PRETTY_FUNCTION__, and so forth. */
- if (current_function
+ if (cfun
&& !current_function_name_declared
&& !has_no_scope)
{
{
pushlevel (0);
if (!building_stmt_tree ()
- && !current_function->x_whole_function_mode_p)
+ && !cfun->x_whole_function_mode_p)
my_friendly_abort (19991129);
if (building_stmt_tree () && !processing_template_decl)
/* If we're outside a function, we won't have a statement-tree to
work with. But, if we see a statement-expression we need to
create one. */
- if (!current_function && !last_tree)
+ if (! cfun && !last_tree)
begin_stmt_tree (&scope_chain->x_saved_tree);
keep_next_level (1);
/* If we created a statement-tree for this statement-expression,
remove it now. */
- if (!current_function
+ if (! cfun
&& TREE_CHAIN (scope_chain->x_saved_tree) == NULL_TREE)
finish_stmt_tree (&scope_chain->x_saved_tree);
*t = stmt;
SET_LAST_STMT (NULL_TREE);
- if (current_function)
+ if (cfun)
{
/* The line-number recorded in the outermost statement in a function
is the line number of the end of the function. */
x);
TREE_ADDRESSABLE (x) = 1;
TREE_USED (x) = 1;
- if (current_function && expanding_p)
+ if (cfun && expanding_p)
put_var_into_stack (x);
return 1;
/* During RTL generation, we also keep a list of free INSN rtl codes. */
static rtx free_insn;
-#define first_insn (current_function->emit->x_first_insn)
-#define last_insn (current_function->emit->x_last_insn)
-#define cur_insn_uid (current_function->emit->x_cur_insn_uid)
-#define last_linenum (current_function->emit->x_last_linenum)
-#define last_filename (current_function->emit->x_last_filename)
-#define first_label_num (current_function->emit->x_first_label_num)
+#define first_insn (cfun->emit->x_first_insn)
+#define last_insn (cfun->emit->x_last_insn)
+#define cur_insn_uid (cfun->emit->x_cur_insn_uid)
+#define last_linenum (cfun->emit->x_last_linenum)
+#define last_filename (cfun->emit->x_last_filename)
+#define first_label_num (cfun->emit->x_first_label_num)
/* This is where the pointer to the obstack being used for RTL is stored. */
extern struct obstack *rtl_obstack;
gen_reg_rtx (mode)
enum machine_mode mode;
{
- struct function *f = current_function;
+ struct function *f = cfun;
register rtx val;
/* Don't let anything called after initial flow analysis create new
void
init_emit ()
{
- struct function *f = current_function;
+ struct function *f = cfun;
f->emit = (struct emit_status *) xmalloc (sizeof (struct emit_status));
first_insn = NULL;
void
init_eh_for_function ()
{
- current_function->eh
- = (struct eh_status *) xcalloc (1, sizeof (struct eh_status));
+ cfun->eh = (struct eh_status *) xcalloc (1, sizeof (struct eh_status));
ehqueue = (struct eh_queue *) xcalloc (1, sizeof (struct eh_queue));
eh_return_context = NULL_RTX;
eh_return_stack_adjust = NULL_RTX;
rtx x_eh_return_stub_label;
};
-#define ehstack (current_function->eh->x_ehstack)
-#define catchstack (current_function->eh->x_catchstack)
-#define ehqueue (current_function->eh->x_ehqueue)
-#define catch_clauses (current_function->eh->x_catch_clauses)
-#define false_label_stack (current_function->eh->x_false_label_stack)
-#define caught_return_label_stack (current_function->eh->x_caught_return_label_stack)
-#define protect_list (current_function->eh->x_protect_list)
-#define current_function_ehc (current_function->eh->ehc)
-#define eh_return_stub_label (current_function->eh->x_eh_return_stub_label)
+#define ehstack (cfun->eh->x_ehstack)
+#define catchstack (cfun->eh->x_catchstack)
+#define ehqueue (cfun->eh->x_ehqueue)
+#define catch_clauses (cfun->eh->x_catch_clauses)
+#define false_label_stack (cfun->eh->x_false_label_stack)
+#define caught_return_label_stack (cfun->eh->x_caught_return_label_stack)
+#define protect_list (cfun->eh->x_protect_list)
+#define current_function_ehc (cfun->eh->ehc)
+#define eh_return_stub_label (cfun->eh->x_eh_return_stub_label)
#ifdef TREE_CODE
/* Start an exception handling region. All instructions emitted after
void
init_expr ()
{
- current_function->expr
- = (struct expr_status *) xmalloc (sizeof (struct expr_status));
+ cfun->expr = (struct expr_status *) xmalloc (sizeof (struct expr_status));
pending_chain = 0;
pending_stack_adjust = 0;
rtx cmem = change_address (mem, mode, NULL_RTX);
- current_function->cannot_inline
- = "function uses short complex types";
+ cfun->cannot_inline = "function uses short complex types";
if (packed_dest_p)
{
memory protection).
Aggregates are not checked here; they're handled elsewhere. */
- if (current_function && current_function_check_memory_usage
+ if (cfun && current_function_check_memory_usage
&& code == VAR_DECL
&& GET_CODE (DECL_RTL (exp)) == MEM
&& ! AGGREGATE_TYPE_P (TREE_TYPE (exp)))
op0 = expand_expr (exp1, NULL_RTX, VOIDmode, EXPAND_SUM);
op0 = memory_address (mode, op0);
- if (current_function && current_function_check_memory_usage
+ if (cfun && current_function_check_memory_usage
&& ! AGGREGATE_TYPE_P (TREE_TYPE (exp)))
{
enum memory_use_mode memory_usage;
tree inline_function_decl;
/* The currently compiled function. */
-struct function *current_function = 0;
+struct function *cfun = 0;
/* Global list of all compiled functions. */
struct function *all_functions = 0;
if (context)
{
context_data = (context == current_function_decl
- ? current_function
+ ? cfun
: find_function_data (context));
context_data->contains_functions = 1;
}
- if (current_function == 0)
+ if (cfun == 0)
init_dummy_function_start ();
- p = current_function;
+ p = cfun;
p->next = outer_function_chain;
outer_function_chain = p;
if (save_machine_status)
(*save_machine_status) (p);
- current_function = 0;
+ cfun = 0;
}
void
struct var_refs_queue *queue;
struct var_refs_queue *next;
- current_function = p;
+ cfun = p;
outer_function_chain = p->next;
current_function_decl = p->decl;
HOST_WIDE_INT
get_frame_size ()
{
- return get_func_frame_size (current_function);
+ return get_func_frame_size (cfun);
}
/* Allocate a stack slot of SIZE bytes and return a MEM rtx for it
/* Allocate in the memory associated with the function in whose frame
we are assigning. */
- if (function != current_function)
+ if (function != cfun)
push_obstacks (function->function_obstack,
function->function_maybepermanent_obstack);
/* If we have already instantiated virtual registers, return the actual
address relative to the frame pointer. */
- if (function == current_function && virtuals_instantiated)
+ if (function == cfun && virtuals_instantiated)
addr = plus_constant (frame_pointer_rtx,
(frame_offset + bigend_correction
+ STARTING_FRAME_OFFSET));
function->x_stack_slot_list
= gen_rtx_EXPR_LIST (VOIDmode, x, function->x_stack_slot_list);
- if (function != current_function)
+ if (function != cfun)
pop_obstacks ();
return x;
HOST_WIDE_INT size;
int align;
{
- return assign_stack_local_1 (mode, size, align, current_function);
+ return assign_stack_local_1 (mode, size, align, cfun);
}
\f
/* Allocate a temporary stack slot and record it for possible later
int used_p;
struct hash_table *ht;
{
- struct function *func = function ? function : current_function;
+ struct function *func = function ? function : cfun;
rtx new = 0;
int regno = original_regno;
#define TRAMPOLINE_REAL_SIZE (TRAMPOLINE_SIZE)
#endif
tramp = assign_stack_local_1 (BLKmode, TRAMPOLINE_REAL_SIZE, 0,
- fp ? fp : current_function);
+ fp ? fp : cfun);
#endif
/* Record the trampoline for reuse and note it for later initialization
/* In whole-function mode, we might not have seen the whole function
yet, so we might not use up all the blocks. */
if (n_blocks != current_block_number
- && !current_function->x_whole_function_mode_p)
+ && !cfun->x_whole_function_mode_p)
abort ();
free (block_vector);
static void
prepare_function_start ()
{
- current_function = (struct function *) xcalloc (1, sizeof (struct function));
+ cfun = (struct function *) xcalloc (1, sizeof (struct function));
init_stmt_for_function ();
init_eh_for_function ();
/* We haven't done register allocation yet. */
reg_renumber = 0;
- init_varasm_status (current_function);
+ init_varasm_status (cfun);
/* Clear out data used for inlining. */
- current_function->inlinable = 0;
- current_function->original_decl_initial = 0;
- current_function->original_arg_vector = 0;
+ cfun->inlinable = 0;
+ cfun->original_decl_initial = 0;
+ cfun->original_arg_vector = 0;
- current_function->stack_alignment_needed = 0;
+ cfun->stack_alignment_needed = 0;
/* Set if a call to setjmp is seen. */
current_function_calls_setjmp = 0;
current_function_outgoing_args_size = 0;
if (init_lang_status)
- (*init_lang_status) (current_function);
+ (*init_lang_status) (cfun);
if (init_machine_status)
- (*init_machine_status) (current_function);
+ (*init_machine_status) (cfun);
}
/* Initialize the rtl expansion mechanism so that we can do simple things
prepare_function_start ();
/* Remember this function for later. */
- current_function->next_global = all_functions;
- all_functions = current_function;
+ cfun->next_global = all_functions;
+ all_functions = cfun;
current_function_name = (*decl_printable_name) (subr, 2);
- current_function->decl = subr;
+ cfun->decl = subr;
/* Nonzero if this is a nested function that uses a static chain. */
/* Outside function body, can't compute type's actual size
until next function's body starts. */
- free_after_parsing (current_function);
- free_after_compilation (current_function);
- free (current_function);
- current_function = 0;
+ free_after_parsing (cfun);
+ free_after_compilation (cfun);
+ free (cfun);
+ cfun = 0;
}
/* Emit CODE for each register of the return value. Useful values for
};
/* For backward compatibility... eventually these should all go away. */
-#define reg_rtx_no (current_function->emit->x_reg_rtx_no)
-#define seq_rtl_expr (current_function->emit->sequence_rtl_expr)
-#define regno_reg_rtx (current_function->emit->x_regno_reg_rtx)
-#define seq_stack (current_function->emit->sequence_stack)
+#define reg_rtx_no (cfun->emit->x_reg_rtx_no)
+#define seq_rtl_expr (cfun->emit->sequence_rtl_expr)
+#define regno_reg_rtx (cfun->emit->x_regno_reg_rtx)
+#define seq_stack (cfun->emit->sequence_stack)
-#define REGNO_POINTER_ALIGN(REGNO) \
- (current_function->emit->regno_pointer_align[REGNO])
-#define REGNO_POINTER_FLAG(REGNO) \
- (current_function->emit->regno_pointer_flag[REGNO])
+#define REGNO_POINTER_ALIGN(REGNO) (cfun->emit->regno_pointer_align[REGNO])
+#define REGNO_POINTER_FLAG(REGNO) (cfun->emit->regno_pointer_flag[REGNO])
struct expr_status
{
rtx x_pending_chain;
};
-#define pending_stack_adjust (current_function->expr->x_pending_stack_adjust)
-#define inhibit_defer_pop (current_function->expr->x_inhibit_defer_pop)
-#define saveregs_value (current_function->expr->x_saveregs_value)
-#define apply_args_value (current_function->expr->x_apply_args_value)
-#define forced_labels (current_function->expr->x_forced_labels)
-#define pending_chain (current_function->expr->x_pending_chain)
+#define pending_stack_adjust (cfun->expr->x_pending_stack_adjust)
+#define inhibit_defer_pop (cfun->expr->x_inhibit_defer_pop)
+#define saveregs_value (cfun->expr->x_saveregs_value)
+#define apply_args_value (cfun->expr->x_apply_args_value)
+#define forced_labels (cfun->expr->x_forced_labels)
+#define pending_chain (cfun->expr->x_pending_chain)
/* This structure can save all the important global and static variables
describing the status of the current function. */
rtx epilogue_delay_list;
};
-extern struct function *current_function;
+/* The function currently being compiled. */
+extern struct function *cfun;
+
+/* A list of all functions we have compiled so far. */
extern struct function *all_functions;
/* For backward compatibility... eventually these should all go away. */
-#define current_function_name (current_function->name)
-#define current_function_pops_args (current_function->pops_args)
-#define current_function_returns_struct (current_function->returns_struct)
-#define current_function_returns_pcc_struct (current_function->returns_pcc_struct)
-#define current_function_returns_pointer (current_function->returns_pointer)
-#define current_function_needs_context (current_function->needs_context)
-#define current_function_calls_setjmp (current_function->calls_setjmp)
-#define current_function_calls_alloca (current_function->calls_alloca)
-#define current_function_calls_longjmp (current_function->calls_longjmp)
-#define current_function_has_computed_jump (current_function->has_computed_jump)
-#define current_function_contains_functions (current_function->contains_functions)
-#define current_function_is_thunk (current_function->is_thunk)
-#define current_function_args_info (current_function->args_info)
-#define current_function_args_size (current_function->args_size)
-#define current_function_pretend_args_size (current_function->pretend_args_size)
-#define current_function_outgoing_args_size (current_function->outgoing_args_size)
-#define current_function_arg_offset_rtx (current_function->arg_offset_rtx)
-#define current_function_varargs (current_function->varargs)
-#define current_function_stdarg (current_function->stdarg)
-#define current_function_internal_arg_pointer (current_function->internal_arg_pointer)
-#define current_function_return_rtx (current_function->return_rtx)
-#define current_function_instrument_entry_exit (current_function->instrument_entry_exit)
-#define current_function_check_memory_usage (current_function->check_memory_usage)
-#define current_function_limit_stack (current_function->limit_stack)
-#define current_function_uses_pic_offset_table (current_function->uses_pic_offset_table)
-#define current_function_uses_const_pool (current_function->uses_const_pool)
-#define current_function_cannot_inline (current_function->cannot_inline)
-#define current_function_epilogue_delay_list (current_function->epilogue_delay_list)
-#define current_function_has_nonlocal_label (current_function->has_nonlocal_label)
-#define current_function_has_nonlocal_goto (current_function->has_nonlocal_goto)
-
-#define max_parm_reg (current_function->x_max_parm_reg)
-#define parm_reg_stack_loc (current_function->x_parm_reg_stack_loc)
-#define cleanup_label (current_function->x_cleanup_label)
-#define return_label (current_function->x_return_label)
-#define save_expr_regs (current_function->x_save_expr_regs)
-#define stack_slot_list (current_function->x_stack_slot_list)
-#define parm_birth_insn (current_function->x_parm_birth_insn)
-#define frame_offset (current_function->x_frame_offset)
-#define tail_recursion_label (current_function->x_tail_recursion_label)
-#define tail_recursion_reentry (current_function->x_tail_recursion_reentry)
-#define arg_pointer_save_area (current_function->x_arg_pointer_save_area)
-#define rtl_expr_chain (current_function->x_rtl_expr_chain)
-#define last_parm_insn (current_function->x_last_parm_insn)
-#define context_display (current_function->x_context_display)
-#define trampoline_list (current_function->x_trampoline_list)
-#define function_call_count (current_function->x_function_call_count)
-#define temp_slots (current_function->x_temp_slots)
-#define temp_slot_level (current_function->x_temp_slot_level)
-#define target_temp_slot_level (current_function->x_target_temp_slot_level)
-#define var_temp_slot_level (current_function->x_var_temp_slot_level)
-#define nonlocal_labels (current_function->x_nonlocal_labels)
-#define nonlocal_goto_handler_slots (current_function->x_nonlocal_goto_handler_slots)
-#define nonlocal_goto_handler_labels (current_function->x_nonlocal_goto_handler_labels)
-#define nonlocal_goto_stack_level (current_function->x_nonlocal_goto_stack_level)
+#define current_function_name (cfun->name)
+#define current_function_pops_args (cfun->pops_args)
+#define current_function_returns_struct (cfun->returns_struct)
+#define current_function_returns_pcc_struct (cfun->returns_pcc_struct)
+#define current_function_returns_pointer (cfun->returns_pointer)
+#define current_function_needs_context (cfun->needs_context)
+#define current_function_calls_setjmp (cfun->calls_setjmp)
+#define current_function_calls_alloca (cfun->calls_alloca)
+#define current_function_calls_longjmp (cfun->calls_longjmp)
+#define current_function_has_computed_jump (cfun->has_computed_jump)
+#define current_function_contains_functions (cfun->contains_functions)
+#define current_function_is_thunk (cfun->is_thunk)
+#define current_function_args_info (cfun->args_info)
+#define current_function_args_size (cfun->args_size)
+#define current_function_pretend_args_size (cfun->pretend_args_size)
+#define current_function_outgoing_args_size (cfun->outgoing_args_size)
+#define current_function_arg_offset_rtx (cfun->arg_offset_rtx)
+#define current_function_varargs (cfun->varargs)
+#define current_function_stdarg (cfun->stdarg)
+#define current_function_internal_arg_pointer (cfun->internal_arg_pointer)
+#define current_function_return_rtx (cfun->return_rtx)
+#define current_function_instrument_entry_exit (cfun->instrument_entry_exit)
+#define current_function_check_memory_usage (cfun->check_memory_usage)
+#define current_function_limit_stack (cfun->limit_stack)
+#define current_function_uses_pic_offset_table (cfun->uses_pic_offset_table)
+#define current_function_uses_const_pool (cfun->uses_const_pool)
+#define current_function_cannot_inline (cfun->cannot_inline)
+#define current_function_epilogue_delay_list (cfun->epilogue_delay_list)
+#define current_function_has_nonlocal_label (cfun->has_nonlocal_label)
+#define current_function_has_nonlocal_goto (cfun->has_nonlocal_goto)
+
+#define max_parm_reg (cfun->x_max_parm_reg)
+#define parm_reg_stack_loc (cfun->x_parm_reg_stack_loc)
+#define cleanup_label (cfun->x_cleanup_label)
+#define return_label (cfun->x_return_label)
+#define save_expr_regs (cfun->x_save_expr_regs)
+#define stack_slot_list (cfun->x_stack_slot_list)
+#define parm_birth_insn (cfun->x_parm_birth_insn)
+#define frame_offset (cfun->x_frame_offset)
+#define tail_recursion_label (cfun->x_tail_recursion_label)
+#define tail_recursion_reentry (cfun->x_tail_recursion_reentry)
+#define arg_pointer_save_area (cfun->x_arg_pointer_save_area)
+#define rtl_expr_chain (cfun->x_rtl_expr_chain)
+#define last_parm_insn (cfun->x_last_parm_insn)
+#define context_display (cfun->x_context_display)
+#define trampoline_list (cfun->x_trampoline_list)
+#define function_call_count (cfun->x_function_call_count)
+#define temp_slots (cfun->x_temp_slots)
+#define temp_slot_level (cfun->x_temp_slot_level)
+#define target_temp_slot_level (cfun->x_target_temp_slot_level)
+#define var_temp_slot_level (cfun->x_var_temp_slot_level)
+#define nonlocal_labels (cfun->x_nonlocal_labels)
+#define nonlocal_goto_handler_slots (cfun->x_nonlocal_goto_handler_slots)
+#define nonlocal_goto_handler_labels (cfun->x_nonlocal_goto_handler_labels)
+#define nonlocal_goto_stack_level (cfun->x_nonlocal_goto_stack_level)
/* The FUNCTION_DECL for an inline function currently being expanded. */
extern tree inline_function_decl;
preserve_data ();
- current_function->inl_max_label_num = max_label_num ();
- current_function->inl_last_parm_insn = current_function->x_last_parm_insn;
- current_function->original_arg_vector = argvec;
- current_function->original_decl_initial = DECL_INITIAL (fndecl);
- DECL_SAVED_INSNS (fndecl) = current_function;
+ cfun->inl_max_label_num = max_label_num ();
+ cfun->inl_last_parm_insn = cfun->x_last_parm_insn;
+ cfun->original_arg_vector = argvec;
+ cfun->original_decl_initial = DECL_INITIAL (fndecl);
+ DECL_SAVED_INSNS (fndecl) = cfun;
/* Clean up. */
free (parmdecl_map);
if (inl_f->calls_alloca)
emit_stack_restore (SAVE_BLOCK, stack_save, NULL_RTX);
- if (!current_function->x_whole_function_mode_p)
+ if (! cfun->x_whole_function_mode_p)
/* In statement-at-a-time mode, we just tell the front-end to add
this block to the list of blocks at this binding level. We
can't do it the way it's done for function-at-a-time mode the
remapped label. Otherwise, symbols are returned unchanged. */
if (CONSTANT_POOL_ADDRESS_P (orig))
{
- struct function *f = inlining ? inlining : current_function;
+ struct function *f = inlining ? inlining : cfun;
rtx constant = get_pool_constant_for_function (f, orig);
enum machine_mode const_mode = get_pool_mode_for_function (f, orig);
if (inlining)
output_inline_function (fndecl)
tree fndecl;
{
- struct function *curf = current_function;
+ struct function *old_cfun = cfun;
struct function *f = DECL_SAVED_INSNS (fndecl);
- current_function = f;
+ cfun = f;
current_function_decl = fndecl;
clear_emit_caches ();
/* Compile this function all the way down to assembly code. */
rest_of_compilation (fndecl);
- current_function = curf;
- current_function_decl = curf ? curf->decl : 0;
+ cfun = old_cfun;
+ current_function_decl = old_cfun ? old_cfun->decl : 0;
}
struct goto_fixup *x_goto_fixup_chain;
};
-#define block_stack (current_function->stmt->x_block_stack)
-#define stack_block_stack (current_function->stmt->x_stack_block_stack)
-#define cond_stack (current_function->stmt->x_cond_stack)
-#define loop_stack (current_function->stmt->x_loop_stack)
-#define case_stack (current_function->stmt->x_case_stack)
-#define nesting_stack (current_function->stmt->x_nesting_stack)
-#define nesting_depth (current_function->stmt->x_nesting_depth)
-#define current_block_start_count (current_function->stmt->x_block_start_count)
-#define last_expr_type (current_function->stmt->x_last_expr_type)
-#define last_expr_value (current_function->stmt->x_last_expr_value)
-#define expr_stmts_for_value (current_function->stmt->x_expr_stmts_for_value)
-#define emit_filename (current_function->stmt->x_emit_filename)
-#define emit_lineno (current_function->stmt->x_emit_lineno)
-#define goto_fixup_chain (current_function->stmt->x_goto_fixup_chain)
+#define block_stack (cfun->stmt->x_block_stack)
+#define stack_block_stack (cfun->stmt->x_stack_block_stack)
+#define cond_stack (cfun->stmt->x_cond_stack)
+#define loop_stack (cfun->stmt->x_loop_stack)
+#define case_stack (cfun->stmt->x_case_stack)
+#define nesting_stack (cfun->stmt->x_nesting_stack)
+#define nesting_depth (cfun->stmt->x_nesting_depth)
+#define current_block_start_count (cfun->stmt->x_block_start_count)
+#define last_expr_type (cfun->stmt->x_last_expr_type)
+#define last_expr_value (cfun->stmt->x_last_expr_value)
+#define expr_stmts_for_value (cfun->stmt->x_expr_stmts_for_value)
+#define emit_filename (cfun->stmt->x_emit_filename)
+#define emit_lineno (cfun->stmt->x_emit_lineno)
+#define goto_fixup_chain (cfun->stmt->x_goto_fixup_chain)
/* Non-zero if we are using EH to handle cleanus. */
static int using_eh_for_cleanups_p = 0;
void
init_stmt_for_function ()
{
- current_function->stmt
- = (struct stmt_status *) xmalloc (sizeof (struct stmt_status));
+ cfun->stmt = (struct stmt_status *) xmalloc (sizeof (struct stmt_status));
/* We are not currently within any block, conditional, loop or case. */
block_stack = 0;
block = make_node (BLOCK);
TREE_USED (block) = 1;
- if (!current_function->x_whole_function_mode_p)
+ if (!cfun->x_whole_function_mode_p)
insert_block (block);
else
{
start_sequence ();
start = emit_note (NULL_PTR, NOTE_INSN_BLOCK_BEG);
- if (current_function->x_whole_function_mode_p)
+ if (cfun->x_whole_function_mode_p)
NOTE_BLOCK (start) = block;
fixup->before_jump = emit_note (NULL_PTR, NOTE_INSN_DELETED);
end = emit_note (NULL_PTR, NOTE_INSN_BLOCK_END);
- if (current_function->x_whole_function_mode_p)
+ if (cfun->x_whole_function_mode_p)
NOTE_BLOCK (end) = block;
fixup->context = block;
end_sequence ();
if (flag_expensive_optimizations)
return 1;
- if (optimize == 0 || current_function == 0
- || current_function->stmt == 0 || loop_stack == 0)
+ if (optimize == 0 || cfun == 0 || cfun->stmt == 0 || loop_stack == 0)
return 0;
insn = get_last_insn_anywhere ();
int
is_eh_region ()
{
- return (current_function && block_stack
- && block_stack->data.block.exception_region);
+ return cfun && block_stack && block_stack->data.block.exception_region;
}
/* Emit a handler label for a nonlocal goto handler.
struct nesting *thisblock;
/* Error if we are not in any block. */
- if (current_function == 0 || block_stack == 0)
+ if (cfun == 0 || block_stack == 0)
return 0;
thisblock = block_stack;
tree cleanup;
/* Error if we are not in any block. */
- if (current_function == 0 || block_stack == 0)
+ if (cfun == 0 || block_stack == 0)
return 0;
thisblock = block_stack;
tree cleanup;
/* Error if we are not in any block. */
- if (current_function == 0 || block_stack == 0)
+ if (cfun == 0 || block_stack == 0)
return 0;
thisblock = block_stack;
expand_anon_union_decl (decl, cleanup, decl_elts)
tree decl, cleanup, decl_elts;
{
- struct nesting *thisblock = current_function == 0 ? 0 : block_stack;
+ struct nesting *thisblock = cfun == 0 ? 0 : block_stack;
rtx x;
tree t;
{
struct nesting *block;
- if (current_function == NULL || current_function->stmt == NULL
- || block_stack == 0)
+ if (cfun == NULL || cfun->stmt == NULL || block_stack == 0)
return 0;
if (this_contour && block_stack->data.block.cleanups != NULL)
Also, we would like to pass const0_rtx here, but don't have it. */
expand_expr (size, expand_expr (integer_zero_node, NULL_PTR, VOIDmode, 0),
VOIDmode, 0);
- else if (current_function != 0
- && current_function->x_dont_save_pending_sizes_p)
+ else if (cfun != 0
+ && cfun->x_dont_save_pending_sizes_p)
/* The front-end doesn't want us to keep a list of the expressions
that determine sizes for variable size objects. */
;
/* In function-at-a-time mode, we do not attempt to keep the BLOCK
tree in sensible shape. So, we just recalculate it here. */
- if (current_function->x_whole_function_mode_p)
+ if (cfun->x_whole_function_mode_p)
{
find_loop_tree_blocks ();
unroll_block_trees ();
init_recog_no_volatile ();
/* We're done with this function. Free up memory if we can. */
- free_after_parsing (current_function);
+ free_after_parsing (cfun);
if (! DECL_DEFER_OUTPUT (decl))
- free_after_compilation (current_function);
- current_function = 0;
+ free_after_compilation (cfun);
+ cfun = 0;
if (ggc_p)
ggc_collect ();
}
/* Use our current register alignment and pointer flags. */
- map->regno_pointer_flag = current_function->emit->regno_pointer_flag;
- map->regno_pointer_align = current_function->emit->regno_pointer_align;
+ map->regno_pointer_flag = cfun->emit->regno_pointer_flag;
+ map->regno_pointer_align = cfun->emit->regno_pointer_align;
/* If the loop is being partially unrolled, and the iteration variables
are being split, and are being renamed for the split, then must fix up
rtx x_const_double_chain;
};
-#define const_rtx_hash_table (current_function->varasm->x_const_rtx_hash_table)
-#define const_rtx_sym_hash_table (current_function->varasm->x_const_rtx_sym_hash_table)
-#define first_pool (current_function->varasm->x_first_pool)
-#define last_pool (current_function->varasm->x_last_pool)
-#define pool_offset (current_function->varasm->x_pool_offset)
-#define const_double_chain (current_function->varasm->x_const_double_chain)
+#define const_rtx_hash_table (cfun->varasm->x_const_rtx_hash_table)
+#define const_rtx_sym_hash_table (cfun->varasm->x_const_rtx_sym_hash_table)
+#define first_pool (cfun->varasm->x_first_pool)
+#define last_pool (cfun->varasm->x_last_pool)
+#define pool_offset (cfun->varasm->x_pool_offset)
+#define const_double_chain (cfun->varasm->x_const_double_chain)
/* Number for making the label on the next
constant that is stored in memory. */
/* Search the chain for an existing CONST_DOUBLE with the right value.
If one is found, return it. */
- if (current_function != 0)
+ if (cfun != 0)
for (r = const_double_chain; r; r = CONST_DOUBLE_CHAIN (r))
if (CONST_DOUBLE_LOW (r) == i0 && CONST_DOUBLE_HIGH (r) == i1
&& GET_MODE (r) == mode)
/* Search the chain for an existing CONST_DOUBLE with the right value.
If one is found, return it. */
- if (current_function != 0)
+ if (cfun != 0)
for (r = const_double_chain; r; r = CONST_DOUBLE_CHAIN (r))
if (! bcmp ((char *) &CONST_DOUBLE_LOW (r), (char *) &u, sizeof u)
&& GET_MODE (r) == mode)
get_pool_constant (addr)
rtx addr;
{
- return (find_pool_constant (current_function, addr))->constant;
+ return (find_pool_constant (cfun, addr))->constant;
}
/* Likewise, but for the constant pool of a specific function. */
get_pool_mode (addr)
rtx addr;
{
- return (find_pool_constant (current_function, addr))->mode;
+ return (find_pool_constant (cfun, addr))->mode;
}
enum machine_mode
get_pool_offset (addr)
rtx addr;
{
- return (find_pool_constant (current_function, addr))->offset;
+ return (find_pool_constant (cfun, addr))->offset;
}
/* Return the size of the constant pool. */
if (GET_CODE (x) == SYMBOL_REF)
{
if (CONSTANT_POOL_ADDRESS_P (x))
- find_pool_constant (current_function, x)->mark = 1;
+ find_pool_constant (cfun, x)->mark = 1;
return;
}
/* Never search inside a CONST_DOUBLE, because CONST_DOUBLE_MEM may be