Commit b64336b8 by Nathan Froyd Committed by Nathan Froyd

sh-protos.h (sh_function_arg): Delete.

	* config/sh/sh-protos.h (sh_function_arg): Delete.
	(sh_function_arg_advance): Delete.
	* config/sh/sh.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
	(PASS_IN_REG_P): Eliminate cast.
	* config/sh/sh.c (sh_function_arg_advance): Make static.  Take a
	const_tree and a bool.
	(sh_function_arg): Likewise.
	(sh_output_mi_thunk): Call sh_function_arg_advance) and
	sh_function_arg.
	(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.

From-SVN: r163607
parent 79ad70f9
2010-08-27 Nathan Froyd <froydnj@codesourcery.com>
* config/sh/sh-protos.h (sh_function_arg): Delete.
(sh_function_arg_advance): Delete.
* config/sh/sh.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
(PASS_IN_REG_P): Eliminate cast.
* config/sh/sh.c (sh_function_arg_advance): Make static. Take a
const_tree and a bool.
(sh_function_arg): Likewise.
(sh_output_mi_thunk): Call sh_function_arg_advance) and
sh_function_arg.
(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
2010-08-27 Naveen H.S <naveen.S@kpitcummins.com> 2010-08-27 Naveen H.S <naveen.S@kpitcummins.com>
Kaz Kojima <kkojima@gcc.gnu.org> Kaz Kojima <kkojima@gcc.gnu.org>
......
...@@ -159,8 +159,6 @@ extern void sh_pr_nosave_low_regs (struct cpp_reader *); ...@@ -159,8 +159,6 @@ extern void sh_pr_nosave_low_regs (struct cpp_reader *);
extern rtx function_symbol (rtx, const char *, enum sh_function_kind); extern rtx function_symbol (rtx, const char *, enum sh_function_kind);
extern rtx sh_get_pr_initial_val (void); extern rtx sh_get_pr_initial_val (void);
extern rtx sh_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
extern void sh_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
extern int sh_pass_in_reg_p (CUMULATIVE_ARGS *, enum machine_mode, tree); extern int sh_pass_in_reg_p (CUMULATIVE_ARGS *, enum machine_mode, tree);
extern void sh_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree, signed int, enum machine_mode); extern void sh_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree, signed int, enum machine_mode);
extern bool sh_function_value_regno_p (const unsigned int); extern bool sh_function_value_regno_p (const unsigned int);
......
...@@ -282,6 +282,10 @@ static bool sh_callee_copies (CUMULATIVE_ARGS *, enum machine_mode, ...@@ -282,6 +282,10 @@ static bool sh_callee_copies (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool); const_tree, bool);
static int sh_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, static int sh_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool); tree, bool);
static void sh_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool);
static rtx sh_function_arg (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool);
static bool sh_scalar_mode_supported_p (enum machine_mode); static bool sh_scalar_mode_supported_p (enum machine_mode);
static int sh_dwarf_calling_convention (const_tree); static int sh_dwarf_calling_convention (const_tree);
static void sh_encode_section_info (tree, rtx, int); static void sh_encode_section_info (tree, rtx, int);
...@@ -495,6 +499,10 @@ static const struct attribute_spec sh_attribute_table[] = ...@@ -495,6 +499,10 @@ static const struct attribute_spec sh_attribute_table[] =
#define TARGET_CALLEE_COPIES sh_callee_copies #define TARGET_CALLEE_COPIES sh_callee_copies
#undef TARGET_ARG_PARTIAL_BYTES #undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES sh_arg_partial_bytes #define TARGET_ARG_PARTIAL_BYTES sh_arg_partial_bytes
#undef TARGET_FUNCTION_ARG
#define TARGET_FUNCTION_ARG sh_function_arg
#undef TARGET_FUNCTION_ARG_ADVANCE
#define TARGET_FUNCTION_ARG_ADVANCE sh_function_arg_advance
#undef TARGET_BUILD_BUILTIN_VA_LIST #undef TARGET_BUILD_BUILTIN_VA_LIST
#define TARGET_BUILD_BUILTIN_VA_LIST sh_build_builtin_va_list #define TARGET_BUILD_BUILTIN_VA_LIST sh_build_builtin_va_list
...@@ -8235,10 +8243,9 @@ sh_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode, ...@@ -8235,10 +8243,9 @@ sh_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
NPARM_REGS words is at least partially passed in a register unless NPARM_REGS words is at least partially passed in a register unless
its data type forbids. */ its data type forbids. */
static rtx
rtx
sh_function_arg (CUMULATIVE_ARGS *ca, enum machine_mode mode, sh_function_arg (CUMULATIVE_ARGS *ca, enum machine_mode mode,
tree type, int named) const_tree type, bool named)
{ {
if (! TARGET_SH5 && mode == VOIDmode) if (! TARGET_SH5 && mode == VOIDmode)
return GEN_INT (ca->renesas_abi ? 1 : 0); return GEN_INT (ca->renesas_abi ? 1 : 0);
...@@ -8324,17 +8331,17 @@ sh_function_arg (CUMULATIVE_ARGS *ca, enum machine_mode mode, ...@@ -8324,17 +8331,17 @@ sh_function_arg (CUMULATIVE_ARGS *ca, enum machine_mode mode,
(TYPE is null for libcalls where that information may not be (TYPE is null for libcalls where that information may not be
available.) */ available.) */
void static void
sh_function_arg_advance (CUMULATIVE_ARGS *ca, enum machine_mode mode, sh_function_arg_advance (CUMULATIVE_ARGS *ca, enum machine_mode mode,
tree type, int named) const_tree type, bool named)
{ {
if (ca->force_mem) if (ca->force_mem)
ca->force_mem = 0; ca->force_mem = 0;
else if (TARGET_SH5) else if (TARGET_SH5)
{ {
tree type2 = (ca->byref && type const_tree type2 = (ca->byref && type
? TREE_TYPE (type) ? TREE_TYPE (type)
: type); : type);
enum machine_mode mode2 = (ca->byref && type enum machine_mode mode2 = (ca->byref && type
? TYPE_MODE (type2) ? TYPE_MODE (type2)
: mode); : mode);
...@@ -11493,9 +11500,9 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, ...@@ -11493,9 +11500,9 @@ sh_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
{ {
tree ptype = build_pointer_type (TREE_TYPE (funtype)); tree ptype = build_pointer_type (TREE_TYPE (funtype));
FUNCTION_ARG_ADVANCE (cum, Pmode, ptype, 1); sh_function_arg_advance (&cum, Pmode, ptype, true);
} }
this_rtx = FUNCTION_ARG (cum, Pmode, ptr_type_node, 1); this_rtx = sh_function_arg (&cum, Pmode, ptr_type_node, true);
/* For SHcompact, we only have r0 for a scratch register: r1 is the /* For SHcompact, we only have r0 for a scratch register: r1 is the
static chain pointer (even if you can't have nested virtual functions static chain pointer (even if you can't have nested virtual functions
......
...@@ -1625,17 +1625,12 @@ struct sh_args { ...@@ -1625,17 +1625,12 @@ struct sh_args {
#define INIT_CUMULATIVE_LIBCALL_ARGS(CUM, MODE, LIBNAME) \ #define INIT_CUMULATIVE_LIBCALL_ARGS(CUM, MODE, LIBNAME) \
sh_init_cumulative_args (& (CUM), NULL_TREE, (LIBNAME), NULL_TREE, 0, (MODE)) sh_init_cumulative_args (& (CUM), NULL_TREE, (LIBNAME), NULL_TREE, 0, (MODE))
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
sh_function_arg_advance (&(CUM), (MODE), (TYPE), (NAMED))
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
sh_function_arg (&(CUM), (MODE), (TYPE), (NAMED))
/* Return boolean indicating arg of mode MODE will be passed in a reg. /* Return boolean indicating arg of mode MODE will be passed in a reg.
This macro is only used in this file. */ This macro is only used in this file. */
#define PASS_IN_REG_P(CUM, MODE, TYPE) \ #define PASS_IN_REG_P(CUM, MODE, TYPE) \
(((TYPE) == 0 \ (((TYPE) == 0 \
|| (! TREE_ADDRESSABLE ((tree)(TYPE)) \ || (! TREE_ADDRESSABLE ((TYPE)) \
&& (! (TARGET_HITACHI || (CUM).renesas_abi) \ && (! (TARGET_HITACHI || (CUM).renesas_abi) \
|| ! (AGGREGATE_TYPE_P (TYPE) \ || ! (AGGREGATE_TYPE_P (TYPE) \
|| (!TARGET_FPU_ANY \ || (!TARGET_FPU_ANY \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment