aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/lm32
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-10-28 20:13:18 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-10-28 20:13:18 +0000
commit3acf034c5a48c45c39a5be03369cea154fe39f25 (patch)
tree869db1b8a591c30e2ec23142cb994437066e632e /gcc/config/lm32
parent4665ac17309744645b3c03bf77328bbc040f6954 (diff)
downloadgcc-3acf034c5a48c45c39a5be03369cea154fe39f25.zip
gcc-3acf034c5a48c45c39a5be03369cea154fe39f25.tar.gz
gcc-3acf034c5a48c45c39a5be03369cea154fe39f25.tar.bz2
lm32-protos.h (lm32_function_arg): Delete.
* config/lm32/lm32-protos.h (lm32_function_arg): Delete. * config/lm32/lm32.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. * config/mcore/mcore.c (mcore_function_arg): Declare. Make static. Take a const_tree and a bool. (mcore_function_arg_advance): New function. (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. From-SVN: r166044
Diffstat (limited to 'gcc/config/lm32')
-rw-r--r--gcc/config/lm32/lm32-protos.h2
-rw-r--r--gcc/config/lm32/lm32.c27
-rw-r--r--gcc/config/lm32/lm32.h6
3 files changed, 22 insertions, 13 deletions
diff --git a/gcc/config/lm32/lm32-protos.h b/gcc/config/lm32/lm32-protos.h
index 51e191b..bc086d2 100644
--- a/gcc/config/lm32/lm32-protos.h
+++ b/gcc/config/lm32/lm32-protos.h
@@ -26,8 +26,6 @@ extern void lm32_expand_prologue (void);
extern void lm32_expand_epilogue (void);
extern void lm32_print_operand (FILE *file, rtx op, int letter);
extern void lm32_print_operand_address (FILE *file, rtx addr);
-extern rtx lm32_function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode,
- tree type, int named);
extern HOST_WIDE_INT lm32_compute_initial_elimination_offset (int from,
int to);
extern int lm32_can_use_return (void);
diff --git a/gcc/config/lm32/lm32.c b/gcc/config/lm32/lm32.c
index bcab220..18a4b44 100644
--- a/gcc/config/lm32/lm32.c
+++ b/gcc/config/lm32/lm32.c
@@ -76,6 +76,12 @@ static bool
lm32_legitimate_address_p (enum machine_mode mode, rtx x, bool strict);
static HOST_WIDE_INT lm32_compute_frame_size (int size);
static void lm32_option_override (void);
+static rtx lm32_function_arg (CUMULATIVE_ARGS * cum,
+ enum machine_mode mode, const_tree type,
+ bool named);
+static void lm32_function_arg_advance (CUMULATIVE_ARGS * cum,
+ enum machine_mode mode,
+ const_tree type, bool named);
/* Implement TARGET_OPTION_OPTIMIZATION_TABLE. */
static const struct default_options lm32_option_optimization_table[] =
@@ -98,6 +104,10 @@ static const struct default_options lm32_option_optimization_table[] =
#define TARGET_PROMOTE_FUNCTION_MODE default_promote_function_mode_always_promote
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS lm32_setup_incoming_varargs
+#undef TARGET_FUNCTION_ARG
+#define TARGET_FUNCTION_ARG lm32_function_arg
+#undef TARGET_FUNCTION_ARG_ADVANCE
+#define TARGET_FUNCTION_ARG_ADVANCE lm32_function_arg_advance
#undef TARGET_PROMOTE_PROTOTYPES
#define TARGET_PROMOTE_PROTOTYPES hook_bool_const_tree_true
#undef TARGET_MIN_ANCHOR_OFFSET
@@ -613,9 +623,9 @@ lm32_print_operand_address (FILE * file, rtx addr)
NAMED is nonzero if this argument is a named parameter
(otherwise it is an extra parameter matching an ellipsis). */
-rtx
-lm32_function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode,
- tree type, int named)
+static rtx
+lm32_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named)
{
if (mode == VOIDmode)
/* Compute operand 2 of the call insn. */
@@ -624,10 +634,17 @@ lm32_function_arg (CUMULATIVE_ARGS cum, enum machine_mode mode,
if (targetm.calls.must_pass_in_stack (mode, type))
return NULL_RTX;
- if (!named || (cum + LM32_NUM_REGS2 (mode, type) > LM32_NUM_ARG_REGS))
+ if (!named || (*cum + LM32_NUM_REGS2 (mode, type) > LM32_NUM_ARG_REGS))
return NULL_RTX;
- return gen_rtx_REG (mode, cum + LM32_FIRST_ARG_REG);
+ return gen_rtx_REG (mode, *cum + LM32_FIRST_ARG_REG);
+}
+
+static void
+lm32_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named ATTRIBUTE_UNUSED)
+{
+ *cum += LM32_NUM_REGS2 (mode, type);
}
HOST_WIDE_INT
diff --git a/gcc/config/lm32/lm32.h b/gcc/config/lm32/lm32.h
index cec8351..bcea41a 100644
--- a/gcc/config/lm32/lm32.h
+++ b/gcc/config/lm32/lm32.h
@@ -276,17 +276,11 @@ enum reg_class
/* The number of (integer) argument register available. */
#define LM32_NUM_ARG_REGS 8
-#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
- lm32_function_arg ((CUM), (MODE), (TYPE), (NAMED))
-
#define CUMULATIVE_ARGS int
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT,N_NAMED_ARGS) \
(CUM) = 0
-#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
- (CUM) += LM32_NUM_REGS2 (MODE, TYPE)
-
#define FUNCTION_ARG_REGNO_P(r) \
(((r) >= LM32_FIRST_ARG_REG) && ((r) <= LM32_NUM_ARG_REGS))