h8300-protos.h (function_arg): Delete.

* config/h8300/h8300-protos.h (function_arg): Delete.
	* config/h8300/h8300.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
	* config/h8300/h8300.c (function_arg): Rename to...
	(h8300_function_arg): ...this.  Make static.  Take a const_tree and
	a bool.
	(h8300_function_arg_advance): New function.
	(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.

From-SVN: r166042
This commit is contained in:
Nathan Froyd 2010-10-28 20:06:25 +00:00 committed by Nathan Froyd
parent 66d5ee1440
commit 56f9413b94
4 changed files with 37 additions and 35 deletions

View File

@ -1,3 +1,13 @@
2010-10-28 Nathan Froyd <froydnj@codesourcery.com>
* config/h8300/h8300-protos.h (function_arg): Delete.
* config/h8300/h8300.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
* config/h8300/h8300.c (function_arg): Rename to...
(h8300_function_arg): ...this. Make static. Take a const_tree and
a bool.
(h8300_function_arg_advance): New function.
(TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
2010-10-28 Nathan Froyd <froydnj@codesourcery.com>
* config/arc/arc.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Move code

View File

@ -89,8 +89,6 @@ extern int h8300_ldm_stm_parallel (rtvec, int, int);
#endif /* RTX_CODE */
#ifdef TREE_CODE
extern struct rtx_def *function_arg (CUMULATIVE_ARGS *,
enum machine_mode, tree, int);
extern int h8300_funcvec_function_p (tree);
extern int h8300_eightbit_data_p (tree);
extern int h8300_tiny_data_p (tree);

View File

@ -1095,11 +1095,14 @@ h8300_pr_saveall (struct cpp_reader *pfile ATTRIBUTE_UNUSED)
/* If the next function argument with MODE and TYPE is to be passed in
a register, return a reg RTX for the hard register in which to pass
the argument. CUM represents the state after the last argument.
If the argument is to be pushed, NULL_RTX is returned. */
If the argument is to be pushed, NULL_RTX is returned.
rtx
function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
tree type, int named)
On the H8/300 all normal args are pushed, unless -mquickcall in which
case the first 3 arguments are passed in registers. */
static rtx
h8300_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type, bool named)
{
static const char *const hand_list[] = {
"__main",
@ -1163,6 +1166,20 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
return result;
}
/* 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
h8300_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
const_tree type, bool named ATTRIBUTE_UNUSED)
{
cum->nbytes += (mode != BLKmode
? (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD
: (int_size_in_bytes (type) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD);
}
/* Compute the cost of an and insn. */
@ -5915,6 +5932,12 @@ h8300_trampoline_init (rtx m_tramp, tree fndecl, rtx cxt)
#undef TARGET_RETURN_IN_MEMORY
#define TARGET_RETURN_IN_MEMORY h8300_return_in_memory
#undef TARGET_FUNCTION_ARG
#define TARGET_FUNCTION_ARG h8300_function_arg
#undef TARGET_FUNCTION_ARG_ADVANCE
#define TARGET_FUNCTION_ARG_ADVANCE h8300_function_arg_advance
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG h8300_reorg

View File

@ -600,35 +600,6 @@ struct cum_arg
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
((CUM).nbytes = 0, (CUM).libcall = LIBNAME)
/* 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 += ((MODE) != BLKmode \
? (GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD \
: (int_size_in_bytes (TYPE) + UNITS_PER_WORD - 1) & -UNITS_PER_WORD))
/* 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). */
/* On the H8/300 all normal args are pushed, unless -mquickcall in which
case the first 3 arguments are passed in registers.
See function `function_arg'. */
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
function_arg (&CUM, MODE, TYPE, NAMED)
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */