@@ -35,13 +35,6 @@ extern void xstormy16_asm_output_aligned_common (FILE *, tree, const char *,
int, int, int);
#endif
-#if defined (TREE_CODE) && defined (HAVE_MACHINE_MODES)
-extern CUMULATIVE_ARGS xstormy16_function_arg_advance
- (CUMULATIVE_ARGS, enum machine_mode, tree, int);
-extern rtx xstormy16_function_arg
- (CUMULATIVE_ARGS, enum machine_mode, tree, int);
-#endif
-
#if defined (TREE_CODE) && defined (RTX_CODE)
extern void xstormy16_initialize_trampoline (rtx, rtx, rtx);
extern rtx xstormy16_function_value (const_tree, const_tree);
@@ -1247,11 +1247,10 @@ xstormy16_function_profiler (void)
sorry ("function_profiler support");
}
-/* Return an updated summarizer variable CUM to advance past an
- argument in the argument list. The values MODE, TYPE and NAMED
- describe that argument. Once this is done, the variable CUM is
- suitable for analyzing the *following* argument with
- `FUNCTION_ARG', etc.
+/* Update CUM to advance past an argument in the argument list. The
+ values MODE, TYPE and NAMED describe that argument. Once this is
+ done, the variable CUM is suitable for analyzing the *following*
+ argument with `TARGET_FUNCTION_ARG', etc.
This function need not do anything if the argument in question was
passed on the stack. The compiler knows how to track the amount of
@@ -1259,25 +1258,23 @@ xstormy16_function_profiler (void)
it makes life easier for xstormy16_build_va_list if it does update
the word count. */
-CUMULATIVE_ARGS
-xstormy16_function_arg_advance (CUMULATIVE_ARGS cum, enum machine_mode mode,
- tree type, int named ATTRIBUTE_UNUSED)
+static void
+xstormy16_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named ATTRIBUTE_UNUSED)
{
/* If an argument would otherwise be passed partially in registers,
and partially on the stack, the whole of it is passed on the
stack. */
- if (cum < NUM_ARGUMENT_REGISTERS
- && cum + XSTORMY16_WORD_SIZE (type, mode) > NUM_ARGUMENT_REGISTERS)
- cum = NUM_ARGUMENT_REGISTERS;
-
- cum += XSTORMY16_WORD_SIZE (type, mode);
+ if (*cum < NUM_ARGUMENT_REGISTERS
+ && *cum + XSTORMY16_WORD_SIZE (type, mode) > NUM_ARGUMENT_REGISTERS)
+ *cum = NUM_ARGUMENT_REGISTERS;
- return cum;
+ *cum += XSTORMY16_WORD_SIZE (type, mode);
}
-rtx
-xstormy16_function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode,
- tree type, int named ATTRIBUTE_UNUSED)
+static rtx
+xstormy16_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named ATTRIBUTE_UNUSED)
{
if (mode == VOIDmode)
return const0_rtx;
@@ -2656,6 +2653,11 @@ xstormy16_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
#undef TARGET_PROMOTE_PROTOTYPES
#define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true
+#undef TARGET_FUNCTION_ARG
+#define TARGET_FUNCTION_ARG xstormy16_function_arg
+#undef TARGET_FUNCTION_ARG_ADVANCE
+#define TARGET_FUNCTION_ARG_ADVANCE xstormy16_function_arg_advance
+
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY xstormy16_return_in_memory
@@ -339,9 +339,6 @@ enum reg_class
+ 1) \
/ 2)
-#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
- xstormy16_function_arg (CUM, MODE, TYPE, NAMED)
-
/* For this platform, the value of CUMULATIVE_ARGS is the number of words
of arguments that have been passed in registers so far. */
#define CUMULATIVE_ARGS int
@@ -349,9 +346,6 @@ enum reg_class
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
(CUM) = 0
-#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
- ((CUM) = xstormy16_function_arg_advance (CUM, MODE, TYPE, NAMED))
-
#define FUNCTION_ARG_REGNO_P(REGNO) \
((REGNO) >= FIRST_ARGUMENT_REGISTER \
&& (REGNO) < FIRST_ARGUMENT_REGISTER + NUM_ARGUMENT_REGISTERS)