@@ -42,15 +42,8 @@ extern int avr_progmem_p (tree decl, tree attributes);
#ifdef RTX_CODE /* inside TREE_CODE */
extern void init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
rtx libname, tree fndecl);
-extern rtx function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
- tree type, int named);
#endif /* RTX_CODE inside TREE_CODE */
-#ifdef HAVE_MACHINE_MODES /* inside TREE_CODE */
-extern void function_arg_advance (CUMULATIVE_ARGS *cum,
- enum machine_mode mode, tree type,
- int named);
-#endif /* HAVE_MACHINE_MODES inside TREE_CODE*/
#endif /* TREE_CODE */
#ifdef RTX_CODE
@@ -93,6 +93,10 @@ static unsigned int avr_case_values_threshold (void);
static bool avr_frame_pointer_required_p (void);
static bool avr_can_eliminate (const int, const int);
static bool avr_class_likely_spilled_p (reg_class_t c);
+static rtx avr_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
+ const_tree, bool);
+static void avr_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
+ const_tree, bool);
/* Allocate registers from r25 to r8 for parameters for function calls. */
#define FIRST_CUM_REG 26
@@ -168,6 +172,10 @@ static const struct attribute_spec avr_attribute_table[] =
#define TARGET_ADDRESS_COST avr_address_cost
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG avr_reorg
+#undef TARGET_FUNCTION_ARG
+#define TARGET_FUNCTION_ARG avr_function_arg
+#undef TARGET_FUNCTION_ARG_ADVANCE
+#define TARGET_FUNCTION_ARG_ADVANCE avr_function_arg_advance
#undef TARGET_LEGITIMIZE_ADDRESS
#define TARGET_LEGITIMIZE_ADDRESS avr_legitimize_address
@@ -1566,9 +1574,9 @@ avr_num_arg_regs (enum machine_mode mode, tree type)
/* Controls whether a function argument is passed
in a register, and which register. */
-rtx
-function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
- int named ATTRIBUTE_UNUSED)
+static rtx
+avr_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named ATTRIBUTE_UNUSED)
{
int bytes = avr_num_arg_regs (mode, type);
@@ -1581,9 +1589,9 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
/* Update the summarizer variable CUM to advance past an argument
in the argument list. */
-void
-function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
- int named ATTRIBUTE_UNUSED)
+static void
+avr_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named ATTRIBUTE_UNUSED)
{
int bytes = avr_num_arg_regs (mode, type);
@@ -372,8 +372,6 @@ enum reg_class {
for POST_DEC targets (PR27386). */
/*#define PUSH_ROUNDING(NPUSHED) (NPUSHED)*/
-#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) (function_arg (&(CUM), MODE, TYPE, NAMED))
-
typedef struct avr_args {
int nregs; /* # registers available for passing */
int regno; /* next available register number */
@@ -382,9 +380,6 @@ typedef struct avr_args {
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, FNDECL, N_NAMED_ARGS) \
init_cumulative_args (&(CUM), FNTYPE, LIBNAME, FNDECL)
-#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
- (function_arg_advance (&CUM, MODE, TYPE, NAMED))
-
#define FUNCTION_ARG_REGNO_P(r) function_arg_regno_p(r)
extern int avr_reg_order[];