From 24ef86d7ad359cbe86946ce7cbebe151169909c1 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Thu, 28 Oct 2010 19:52:48 +0000 Subject: [PATCH] iq2000-protos.h (function_arg): Delete. * config/iq2000/iq2000-protos.h (function_arg): Delete. (function_arg_advance): Delete. * config/iq2000/iq2000.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. * config/iq2000/iq2000.c (function_arg): Rename to... (iq2000_function_arg): ...this. Make static. Take a const_tree and a bool. (function_arg_advance): Rename to... (iq2000_function_arg_advance): ...this. Make static. Take a const_tree and a bool. (iq2000_expand_prologue): Call iq2000_function_arg_advance and iq2000_function_arg. (iq2000_pass_by_reference): Call iq2000_function_arg). (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. From-SVN: r166035 --- gcc/ChangeLog | 16 +++++++++++++ gcc/config/iq2000/iq2000-protos.h | 2 -- gcc/config/iq2000/iq2000.c | 37 ++++++++++++++++++++----------- gcc/config/iq2000/iq2000.h | 6 ----- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e8737d40155..daae755efa2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,19 @@ +2010-10-28 Nathan Froyd + + * config/iq2000/iq2000-protos.h (function_arg): Delete. + (function_arg_advance): Delete. + * config/iq2000/iq2000.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. + * config/iq2000/iq2000.c (function_arg): Rename to... + (iq2000_function_arg): ...this. Make static. Take a const_tree and + a bool. + (function_arg_advance): Rename to... + (iq2000_function_arg_advance): ...this. Make static. Take a + const_tree and a bool. + (iq2000_expand_prologue): Call iq2000_function_arg_advance and + iq2000_function_arg. + (iq2000_pass_by_reference): Call iq2000_function_arg). + (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. + 2010-10-28 Nathan Froyd * config/fr30/fr30-protos.h (fr30_num_arg_regs): Delete. diff --git a/gcc/config/iq2000/iq2000-protos.h b/gcc/config/iq2000/iq2000-protos.h index 971aadf4547..067e80747d1 100644 --- a/gcc/config/iq2000/iq2000-protos.h +++ b/gcc/config/iq2000/iq2000-protos.h @@ -42,8 +42,6 @@ extern void gen_conditional_branch (rtx *, enum machine_mode); #ifdef TREE_CODE extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx); -extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int); -extern struct rtx_def * function_arg (CUMULATIVE_ARGS *, enum machine_mode, const_tree, int); extern bool iq2000_function_value_regno_p (const unsigned int); #endif diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index f6caf6084a1..5661fd4eb8f 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -164,6 +164,10 @@ static bool iq2000_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, const_tree, bool); static int iq2000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, tree, bool); +static rtx iq2000_function_arg (CUMULATIVE_ARGS *, + enum machine_mode, const_tree, bool); +static void iq2000_function_arg_advance (CUMULATIVE_ARGS *, + enum machine_mode, const_tree, bool); static void iq2000_va_start (tree, rtx); static bool iq2000_legitimate_address_p (enum machine_mode, rtx, bool); static bool iq2000_can_eliminate (const int, const int); @@ -233,6 +237,10 @@ static const struct default_options iq2000_option_optimization_table[] = #define TARGET_CALLEE_COPIES hook_callee_copies_named #undef TARGET_ARG_PARTIAL_BYTES #define TARGET_ARG_PARTIAL_BYTES iq2000_arg_partial_bytes +#undef TARGET_FUNCTION_ARG +#define TARGET_FUNCTION_ARG iq2000_function_arg +#undef TARGET_FUNCTION_ARG_ADVANCE +#define TARGET_FUNCTION_ARG_ADVANCE iq2000_function_arg_advance #undef TARGET_SETUP_INCOMING_VARARGS #define TARGET_SETUP_INCOMING_VARARGS iq2000_setup_incoming_varargs @@ -1132,9 +1140,9 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, /* Advance the argument of type TYPE and mode MODE to the next argument position in CUM. */ -void -function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, - int named) +static void +iq2000_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, + const_tree type, bool named) { if (TARGET_DEBUG_D_MODE) { @@ -1201,9 +1209,9 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type, /* Return an RTL expression containing the register for the given mode MODE and type TYPE in CUM, or 0 if the argument is to be passed on the stack. */ -struct rtx_def * -function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, const_tree type, - int named) +static rtx +iq2000_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, + const_tree type, bool named) { rtx ret; int regbase = -1; @@ -1939,9 +1947,11 @@ iq2000_expand_prologue (void) passed_mode = Pmode; } - entry_parm = FUNCTION_ARG (args_so_far, passed_mode, passed_type, 1); + entry_parm = iq2000_function_arg (&args_so_far, passed_mode, + passed_type, true); - FUNCTION_ARG_ADVANCE (args_so_far, passed_mode, passed_type, 1); + iq2000_function_arg_advance (&args_so_far, passed_mode, + passed_type, true); next_arg = DECL_CHAIN (cur_arg); if (entry_parm && store_args_on_stack) @@ -1980,10 +1990,11 @@ iq2000_expand_prologue (void) /* In order to pass small structures by value in registers we need to shift the value into the high part of the register. - Function_arg has encoded a PARALLEL rtx, holding a vector of - adjustments to be made as the next_arg_reg variable, so we split up the - insns, and emit them separately. */ - next_arg_reg = FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1); + iq2000_unction_arg has encoded a PARALLEL rtx, holding a vector of + adjustments to be made as the next_arg_reg variable, so we split up + the insns, and emit them separately. */ + next_arg_reg = iq2000_function_arg (&args_so_far, VOIDmode, + void_type_node, true); if (next_arg_reg != 0 && GET_CODE (next_arg_reg) == PARALLEL) { rtvec adjust = XVEC (next_arg_reg, 0); @@ -2293,7 +2304,7 @@ iq2000_pass_by_reference (CUMULATIVE_ARGS *cum, enum machine_mode mode, CUMULATIVE_ARGS temp; temp = *cum; - if (FUNCTION_ARG (temp, mode, type, named) != 0) + if (iq2000_function_arg (&temp, mode, type, named) != 0) return 1; } diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h index 91c5173416d..716be5b7a67 100644 --- a/gcc/config/iq2000/iq2000.h +++ b/gcc/config/iq2000/iq2000.h @@ -359,9 +359,6 @@ enum reg_class /* Function Arguments in Registers. */ -#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ - function_arg (& CUM, MODE, TYPE, NAMED) - #define MAX_ARGS_IN_REGISTERS 8 typedef struct iq2000_args @@ -383,9 +380,6 @@ typedef struct iq2000_args #define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \ init_cumulative_args (& CUM, FNTYPE, LIBNAME) \ -#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ - function_arg_advance (& CUM, MODE, TYPE, NAMED) - #define FUNCTION_ARG_PADDING(MODE, TYPE) \ (! BYTES_BIG_ENDIAN \ ? upward \ -- 2.30.2