mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-04 14:41:14 +08:00
arm.c (TARGET_SETUP_INCOMING_VARARGS): New.
* config/arm/arm.c (TARGET_SETUP_INCOMING_VARARGS): New. (arm_setup_incoming_varargs): Likewise. * config/arm/arm.h (SETUP_INCOMING_VARARGS): Remove. From-SVN: r76643
This commit is contained in:
parent
558d352a12
commit
1cc9f5f5f9
@ -1,3 +1,9 @@
|
||||
2004-01-26 Kazu Hirata <kazu@cs.umass.edu>
|
||||
|
||||
* config/arm/arm.c (TARGET_SETUP_INCOMING_VARARGS): New.
|
||||
(arm_setup_incoming_varargs): Likewise.
|
||||
* config/arm/arm.h (SETUP_INCOMING_VARARGS): Remove.
|
||||
|
||||
2004-01-26 Kazu Hirata <kazu@cs.umass.edu>
|
||||
|
||||
* config/cris/cris.c (TARGET_SETUP_INCOMING_VARARGS): New.
|
||||
|
@ -151,6 +151,8 @@ static void aof_file_start (void);
|
||||
static void aof_file_end (void);
|
||||
#endif
|
||||
static rtx arm_struct_value_rtx (tree, int);
|
||||
static void arm_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
|
||||
tree, int *, int);
|
||||
|
||||
|
||||
/* Initialize the GCC target structure. */
|
||||
@ -242,6 +244,9 @@ static rtx arm_struct_value_rtx (tree, int);
|
||||
#undef TARGET_STRUCT_VALUE_RTX
|
||||
#define TARGET_STRUCT_VALUE_RTX arm_struct_value_rtx
|
||||
|
||||
#undef TARGET_SETUP_INCOMING_VARARGS
|
||||
#define TARGET_SETUP_INCOMING_VARARGS arm_setup_incoming_varargs
|
||||
|
||||
struct gcc_target targetm = TARGET_INITIALIZER;
|
||||
|
||||
/* Obstack for minipool constant handling. */
|
||||
@ -13350,3 +13355,22 @@ arm_struct_value_rtx (tree fntype ATTRIBUTE_UNUSED,
|
||||
return gen_rtx_REG (Pmode, ARG_REGISTER (1));
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Worker function for TARGET_SETUP_INCOMING_VARARGS.
|
||||
|
||||
On the ARM, PRETEND_SIZE is set in order to have the prologue push the last
|
||||
named arg and all anonymous args onto the stack.
|
||||
XXX I know the prologue shouldn't be pushing registers, but it is faster
|
||||
that way. */
|
||||
|
||||
static void
|
||||
arm_setup_incoming_varargs (CUMULATIVE_ARGS *cum,
|
||||
enum machine_mode mode ATTRIBUTE_UNUSED,
|
||||
tree type ATTRIBUTE_UNUSED,
|
||||
int *pretend_size,
|
||||
int second_time ATTRIBUTE_UNUSED)
|
||||
{
|
||||
cfun->machine->uses_anonymous_args = 1;
|
||||
if (cum->nregs < NUM_ARG_REGS)
|
||||
*pretend_size = (NUM_ARG_REGS - cum->nregs) * UNITS_PER_WORD;
|
||||
}
|
||||
|
@ -1703,9 +1703,9 @@ typedef struct
|
||||
|
||||
On the ARM, normally the first 16 bytes are passed in registers r0-r3; all
|
||||
other arguments are passed on the stack. If (NAMED == 0) (which happens
|
||||
only in assign_parms, since SETUP_INCOMING_VARARGS is defined), say it is
|
||||
passed in the stack (function_prologue will indeed make it pass in the
|
||||
stack if necessary). */
|
||||
only in assign_parms, since TARGET_SETUP_INCOMING_VARARGS is
|
||||
defined), say it is passed in the stack (function_prologue will
|
||||
indeed make it pass in the stack if necessary). */
|
||||
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
|
||||
arm_function_arg (&(CUM), (MODE), (TYPE), (NAMED))
|
||||
|
||||
@ -1764,26 +1764,6 @@ typedef struct
|
||||
arm_va_arg (valist, type)
|
||||
|
||||
|
||||
/* Perform any actions needed for a function that is receiving a variable
|
||||
number of arguments. CUM is as above. MODE and TYPE are the mode and type
|
||||
of the current parameter. PRETEND_SIZE is a variable that should be set to
|
||||
the amount of stack that must be pushed by the prolog to pretend that our
|
||||
caller pushed it.
|
||||
|
||||
Normally, this macro will push all remaining incoming registers on the
|
||||
stack and set PRETEND_SIZE to the length of the registers pushed.
|
||||
|
||||
On the ARM, PRETEND_SIZE is set in order to have the prologue push the last
|
||||
named arg and all anonymous args onto the stack.
|
||||
XXX I know the prologue shouldn't be pushing registers, but it is faster
|
||||
that way. */
|
||||
#define SETUP_INCOMING_VARARGS(CUM, MODE, TYPE, PRETEND_SIZE, NO_RTL) \
|
||||
{ \
|
||||
cfun->machine->uses_anonymous_args = 1; \
|
||||
if ((CUM).nregs < NUM_ARG_REGS) \
|
||||
(PRETEND_SIZE) = (NUM_ARG_REGS - (CUM).nregs) * UNITS_PER_WORD; \
|
||||
}
|
||||
|
||||
/* If your target environment doesn't prefix user functions with an
|
||||
underscore, you may wish to re-define this to prevent any conflicts.
|
||||
e.g. AOF may prefix mcount with an underscore. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user