+2010-10-28 Nathan Froyd <froydnj@codesourcery.com>
+
+ * 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 <froydnj@codesourcery.com>
* config/fr30/fr30-protos.h (fr30_num_arg_regs): Delete.
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);
#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
/* 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)
{
/* 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;
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)
/* 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);
CUMULATIVE_ARGS temp;
temp = *cum;
- if (FUNCTION_ARG (temp, mode, type, named) != 0)
+ if (iq2000_function_arg (&temp, mode, type, named) != 0)
return 1;
}
\f
/* 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
#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 \