Commit 3acf034c by Nathan Froyd Committed by Nathan Froyd

lm32-protos.h (lm32_function_arg): Delete.

	* config/lm32/lm32-protos.h (lm32_function_arg): Delete.
	* config/lm32/lm32.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
	* config/mcore/mcore.c (mcore_function_arg): Declare.  Make static.
	Take a const_tree and a bool.
	(mcore_function_arg_advance): New function.
	(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.

From-SVN: r166044
parent 4665ac17
2010-10-28 Nathan Froyd <froydnj@codesourcery.com>
* config/lm32/lm32-protos.h (lm32_function_arg): Delete.
* config/lm32/lm32.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
* config/mcore/mcore.c (mcore_function_arg): Declare. Make static.
Take a const_tree and a bool.
(mcore_function_arg_advance): New function.
(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
2010-10-28 Nathan Froyd <froydnj@codesourcery.com>
* config/mcore/mcore-protos.h (mcore_function_arg): Delete.
* config/mcore/mcore.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
* config/mcore/mcore.c (mcore_function_arg): Declare. Make static.
......@@ -26,8 +26,6 @@ extern void lm32_expand_prologue (void);
extern void lm32_expand_epilogue (void);
extern void lm32_print_operand (FILE *file, rtx op, int letter);
extern void lm32_print_operand_address (FILE *file, rtx addr);
extern rtx lm32_function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode,
tree type, int named);
extern HOST_WIDE_INT lm32_compute_initial_elimination_offset (int from,
int to);
extern int lm32_can_use_return (void);
......
......@@ -76,6 +76,12 @@ static bool
lm32_legitimate_address_p (enum machine_mode mode, rtx x, bool strict);
static HOST_WIDE_INT lm32_compute_frame_size (int size);
static void lm32_option_override (void);
static rtx lm32_function_arg (CUMULATIVE_ARGS * cum,
enum machine_mode mode, const_tree type,
bool named);
static void lm32_function_arg_advance (CUMULATIVE_ARGS * cum,
enum machine_mode mode,
const_tree type, bool named);
/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
static const struct default_options lm32_option_optimization_table[] =
......@@ -98,6 +104,10 @@ static const struct default_options lm32_option_optimization_table[] =
#define TARGET_PROMOTE_FUNCTION_MODE default_promote_function_mode_always_promote
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS lm32_setup_incoming_varargs
#undef TARGET_FUNCTION_ARG
#define TARGET_FUNCTION_ARG lm32_function_arg
#undef TARGET_FUNCTION_ARG_ADVANCE
#define TARGET_FUNCTION_ARG_ADVANCE lm32_function_arg_advance
#undef TARGET_PROMOTE_PROTOTYPES
#define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true
#undef TARGET_MIN_ANCHOR_OFFSET
......@@ -613,9 +623,9 @@ lm32_print_operand_address (FILE * file, rtx addr)
NAMED is nonzero if this argument is a named parameter
(otherwise it is an extra parameter matching an ellipsis). */
rtx
lm32_function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode,
tree type, int named)
static rtx
lm32_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type, bool named)
{
if (mode == VOIDmode)
/* Compute operand 2 of the call insn. */
......@@ -624,10 +634,17 @@ lm32_function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode,
if (targetm.calls.must_pass_in_stack (mode, type))
return NULL_RTX;
if (!named || (cum + LM32_NUM_REGS2 (mode, type) > LM32_NUM_ARG_REGS))
if (!named || (*cum + LM32_NUM_REGS2 (mode, type) > LM32_NUM_ARG_REGS))
return NULL_RTX;
return gen_rtx_REG (mode, cum + LM32_FIRST_ARG_REG);
return gen_rtx_REG (mode, *cum + LM32_FIRST_ARG_REG);
}
static void
lm32_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type, bool named ATTRIBUTE_UNUSED)
{
*cum += LM32_NUM_REGS2 (mode, type);
}
HOST_WIDE_INT
......
......@@ -276,17 +276,11 @@ enum reg_class
/* The number of (integer) argument register available. */
#define LM32_NUM_ARG_REGS 8
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
lm32_function_arg ((CUM), (MODE), (TYPE), (NAMED))
#define CUMULATIVE_ARGS int
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT,N_NAMED_ARGS) \
(CUM) = 0
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
(CUM) += LM32_NUM_REGS2 (MODE, TYPE)
#define FUNCTION_ARG_REGNO_P(r) \
(((r) >= LM32_FIRST_ARG_REG) && ((r) <= LM32_NUM_ARG_REGS))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment