extern int direct_return PARAMS ((void));
extern int get_issue_rate PARAMS ((void));
extern union tree_node *rs6000_build_va_list PARAMS ((void));
-extern void rs6000_save_machine_status PARAMS ((struct function *));
-extern void rs6000_restore_machine_status PARAMS ((struct function *));
extern void rs6000_init_expanders PARAMS ((void));
extern int first_reg_to_save PARAMS ((void));
extern int first_fp_reg_to_save PARAMS ((void));
int fixuplabelno = 0;
#endif
-/* Whether a System V.4 varargs area was created. */
-int rs6000_sysv_varargs_p;
-
/* ABI enumeration available for subtarget to use. */
enum rs6000_abi rs6000_current_abi;
/* Indicate to allocate space on the stack for varargs save area. */
/* ??? Does this really have to be located at a magic spot on the
stack, or can we allocate this with assign_stack_local instead. */
- rs6000_sysv_varargs_p = 1;
+ cfun->machine->sysv_varargs_p = 1;
if (! no_rtl)
save_area = plus_constant (virtual_stack_vars_rtx,
- RS6000_VARARGS_SIZE);
else
{
save_area = virtual_incoming_args_rtx;
- rs6000_sysv_varargs_p = 0;
+ cfun->machine->sysv_varargs_p = 0;
first_reg_offset = cum->words;
if (MUST_PASS_IN_STACK (mode, type))
return pic_offset_table_rtx;
}
\f
-/* Define the structure for the machine field in struct function. */
-struct machine_function
-{
- int sysv_varargs_p;
-};
-
/* Functions to save and restore sysv_varargs_p.
These will be called, via pointer variables,
from push_function_context and pop_function_context. */
-void
-rs6000_save_machine_status (p)
+static void
+rs6000_init_machine_status (p)
struct function *p;
{
- struct machine_function *machine =
- (struct machine_function *) xmalloc (sizeof (struct machine_function));
+ p->machine = (machine_function *) xmalloc (sizeof (machine_function));
- p->machine = machine;
- machine->sysv_varargs_p = rs6000_sysv_varargs_p;
+ p->machine->sysv_varargs_p = 0;
}
-void
-rs6000_restore_machine_status (p)
+static void
+rs6000_free_machine_status (p)
struct function *p;
{
- struct machine_function *machine = p->machine;
-
- rs6000_sysv_varargs_p = machine->sysv_varargs_p;
+ if (p->machine == NULL)
+ return;
- free (machine);
- p->machine = (struct machine_function *)0;
+ free (p->machine);
+ p->machine = NULL;
}
+
/* Do anything needed before RTL is emitted for each function. */
void
rs6000_init_expanders ()
{
- /* Reset varargs */
- rs6000_sysv_varargs_p = 0;
-
/* Arrange to save and restore machine status around nested functions. */
- save_machine_status = rs6000_save_machine_status;
- restore_machine_status = rs6000_restore_machine_status;
+ init_machine_status = rs6000_init_machine_status;
+ free_machine_status = rs6000_free_machine_status;
}
\f
/* Size of the V.4 varargs area if needed */
#define RS6000_VARARGS_AREA 0
-/* Whether a V.4 varargs area is needed */
-extern int rs6000_sysv_varargs_p;
-
/* Align an address */
#define RS6000_ALIGN(n,a) (((n) + (a) - 1) & ~((a) - 1))
|| ((unsigned)((N) - FP_ARG_MIN_REG) < (unsigned)(FP_ARG_NUM_REG)))
\f
+/* A C structure for machine-specific, per-function data.
+ This is added to the cfun structure. */
+typedef struct machine_function
+{
+ /* Whether a System V.4 varargs area was created. */
+ int sysv_varargs_p;
+} machine_function;
+
/* Define a data type for recording info about an argument list
during the scan of that argument list. This data type should
hold all necessary information about the function itself