cris.c (TARGET_SETUP_INCOMING_VARARGS): New.

* config/cris/cris.c (TARGET_SETUP_INCOMING_VARARGS): New.
	(cris_setup_incoming_varargs): Likewise.
	* config/cris/cris.h (SETUP_INCOMING_VARARGS): Remove.

From-SVN: r76640
This commit is contained in:
Kazu Hirata 2004-01-26 15:54:45 +00:00 committed by Kazu Hirata
parent 044701ce86
commit 558d352a12
3 changed files with 31 additions and 22 deletions

View File

@ -1,3 +1,9 @@
2004-01-26 Kazu Hirata <kazu@cs.umass.edu>
* config/cris/cris.c (TARGET_SETUP_INCOMING_VARARGS): New.
(cris_setup_incoming_varargs): Likewise.
* config/cris/cris.h (SETUP_INCOMING_VARARGS): Remove.
2004-01-26 Kazu Hirata <kazu@cs.umass.edu>
* config/ns32k/ns32k.c (TARGET_STRUCT_VALUE_RTX): New.

View File

@ -94,6 +94,9 @@ static struct machine_function * cris_init_machine_status (void);
static rtx cris_struct_value_rtx (tree, int);
static void cris_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
tree type, int *, int);
static int cris_initial_frame_pointer_offset (void);
static int saved_regs_mentioned (rtx);
@ -184,6 +187,9 @@ int cris_cpu_version = CRIS_DEFAULT_CPU_VERSION;
#undef TARGET_STRUCT_VALUE_RTX
#define TARGET_STRUCT_VALUE_RTX cris_struct_value_rtx
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS cris_setup_incoming_varargs
struct gcc_target targetm = TARGET_INITIALIZER;
/* Predicate functions. */
@ -3194,6 +3200,25 @@ cris_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
return gen_rtx_REG (Pmode, CRIS_STRUCT_VALUE_REGNUM);
}
/* Worker function for TARGET_SETUP_INCOMING_VARARGS. */
static void
cris_setup_incoming_varargs (CUMULATIVE_ARGS *ca,
enum machine_mode mode ATTRIBUTE_UNUSED,
tree type ATTRIBUTE_UNUSED,
int *pretend_arg_size,
int second_time)
{
if (ca->regs < CRIS_MAX_ARGS_IN_REGS)
*pretend_arg_size = (CRIS_MAX_ARGS_IN_REGS - ca->regs) * 4;
if (TARGET_PDEBUG)
{
fprintf (asm_out_file,
"\n; VA:: ANSI: %d args before, anon @ #%d, %dtime\n",
ca->regs, *pretend_arg_size, second_time);
}
}
#if 0
/* Various small functions to replace macros. Only called from a
debugger. They might collide with gcc functions or system functions,

View File

@ -1022,28 +1022,6 @@ struct cum_args {int regs;};
/* Node: Varargs */
/* We save the register number of the first anonymous argument in
first_vararg_reg, and take care of this in the function prologue.
This behavior is used by at least one more port (the ARM?), but
may be unsafe when compiling nested functions. (With varargs? Hairy.)
Note that nested-functions is a GNU C extension.
FIXME: We can actually put the size in PRETEND and deduce the number
of registers from it in the prologue and epilogue. */
#define SETUP_INCOMING_VARARGS(ARGSSF, MODE, TYPE, PRETEND, SECOND) \
do \
{ \
if ((ARGSSF).regs < (CRIS_MAX_ARGS_IN_REGS)) \
(PRETEND) = ((CRIS_MAX_ARGS_IN_REGS) - (ARGSSF).regs) * 4; \
if (TARGET_PDEBUG) \
{ \
fprintf (asm_out_file, \
"\n; VA:: ANSI: %d args before, anon @ #%d, %dtime\n", \
(ARGSSF).regs, PRETEND, SECOND); \
} \
} \
while (0)
/* FIXME: This and other EXPAND_BUILTIN_VA_... target macros are not
documented, although used by several targets. */
#define EXPAND_BUILTIN_VA_ARG(VALIST, TYPE) \