* config/v850/v850-protos.h (function_arg): Delete.
* config/v850/v850.h (FUNCTION_ARG): Delete.
(FUNCTION_ARG_ADVANCE): Move code to...
* config/v850/v850.c (v850_function_arg_advance): ...here.
(v850_function_arg): Make static. Take a const_tree and a bool.
(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
From-SVN: r163674
+2010-08-31 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/v850/v850-protos.h (function_arg): Delete.
+ * config/v850/v850.h (FUNCTION_ARG): Delete.
+ (FUNCTION_ARG_ADVANCE): Move code to...
+ * config/v850/v850.c (v850_function_arg_advance): ...here.
+ (v850_function_arg): Make static. Take a const_tree and a bool.
+ (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
+
2010-08-31 Nathan Froyd <froydnj@codesourcery.com>
* config/m32r/m32r.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Move
extern rtx v850_gen_compare (enum rtx_code, Mmode, rtx, rtx);
extern Mmode v850_gen_float_compare (enum rtx_code, Mmode, rtx, rtx);
extern Mmode v850_select_cc_mode (RTX_CODE, rtx, rtx);
-#ifdef TREE_CODE
-extern rtx function_arg (CUMULATIVE_ARGS *, Mmode, tree, int);
-#endif
#endif
-#endif /* TREE_CODE */
+#endif /* RTX_CODE */
#ifdef TREE_CODE
extern int v850_interrupt_function_p (tree);
static int v850_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static bool v850_strict_argument_naming (CUMULATIVE_ARGS *);
+static rtx v850_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
+ const_tree, bool);
+static void v850_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
+ const_tree, bool);
static bool v850_can_eliminate (const int, const int);
static void v850_asm_trampoline_template (FILE *);
static void v850_trampoline_init (rtx, tree, rtx);
#undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES v850_arg_partial_bytes
+#undef TARGET_FUNCTION_ARG
+#define TARGET_FUNCTION_ARG v850_function_arg
+
+#undef TARGET_FUNCTION_ARG_ADVANCE
+#define TARGET_FUNCTION_ARG_ADVANCE v850_function_arg_advance
+
#undef TARGET_CAN_ELIMINATE
#define TARGET_CAN_ELIMINATE v850_can_eliminate
and type TYPE will be passed to a function. If the result
is NULL_RTX, the argument will be pushed. */
-rtx
-function_arg (CUMULATIVE_ARGS * cum,
- enum machine_mode mode,
- tree type,
- int named)
+static rtx
+v850_function_arg (CUMULATIVE_ARGS * cum, enum machine_mode mode,
+ const_tree type, bool named)
{
rtx result = NULL_RTX;
int size, align;
return 4 * UNITS_PER_WORD - cum->nbytes;
}
+/* Update the data in CUM to advance over an argument
+ of mode MODE and data type TYPE.
+ (TYPE is null for libcalls where that information may not be available.) */
+
+static void
+v850_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named ATTRIBUTE_UNUSED)
+{
+ cum->nbytes += (((type && int_size_in_bytes (type) > 8
+ ? GET_MODE_SIZE (Pmode)
+ : (mode != BLKmode
+ ? GET_MODE_SIZE (mode)
+ : int_size_in_bytes (type))) + UNITS_PER_WORD - 1)
+ & -UNITS_PER_WORD);
+}
+
/* Return the high and low words of a CONST_DOUBLE */
static void
#define CUMULATIVE_ARGS struct cum_arg
struct cum_arg { int nbytes; int anonymous_args; };
-/* Define where to put the arguments to a function.
- Value is zero to push the argument on the stack,
- or a hard register in which to store the argument.
-
- MODE is the argument's machine mode.
- TYPE is the data type of the argument (as a tree).
- This is null for libcalls where that information may
- not be available.
- CUM is a variable of type CUMULATIVE_ARGS which gives info about
- the preceding args and about the function being called.
- NAMED is nonzero if this argument is a named parameter
- (otherwise it is an extra parameter matching an ellipsis). */
-
-#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
- function_arg (&CUM, MODE, TYPE, NAMED)
-
/* Initialize a variable CUM of type CUMULATIVE_ARGS
for a call to a function whose data type is FNTYPE.
For a library call, FNTYPE is 0. */
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
((CUM).nbytes = 0, (CUM).anonymous_args = 0)
-/* Update the data in CUM to advance over an argument
- of mode MODE and data type TYPE.
- (TYPE is null for libcalls where that information may not be available.) */
-#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
- ((CUM).nbytes += \
- ((((TYPE) && int_size_in_bytes (TYPE) > 8) \
- ? GET_MODE_SIZE (Pmode) \
- : ((MODE) != BLKmode \
- ? GET_MODE_SIZE ((MODE)) \
- : int_size_in_bytes ((TYPE)))) \
- + UNITS_PER_WORD - 1) & -UNITS_PER_WORD)
-
/* When a parameter is passed in a register, stack space is still
allocated for it. */
#define REG_PARM_STACK_SPACE(DECL) 0