diff options
author | Nathan Froyd <froydnj@codesourcery.com> | 2010-10-28 20:06:25 +0000 |
---|---|---|
committer | Nathan Froyd <froydnj@gcc.gnu.org> | 2010-10-28 20:06:25 +0000 |
commit | 56f9413b9442d24f6b0ea85e18103eb8399c0063 (patch) | |
tree | 94974720a031e0437a65211fe1386ec44c12f2a9 /gcc | |
parent | 66d5ee1440253133ff2a483f61b2468957cf407f (diff) | |
download | gcc-56f9413b9442d24f6b0ea85e18103eb8399c0063.zip gcc-56f9413b9442d24f6b0ea85e18103eb8399c0063.tar.gz gcc-56f9413b9442d24f6b0ea85e18103eb8399c0063.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/config/h8300/h8300-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.c | 31 | ||||
-rw-r--r-- | gcc/config/h8300/h8300.h | 29 |
4 files changed, 37 insertions, 35 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4866fbb..6d1519e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,15 @@ 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 to... * config/arc/arc.c (arc_function_arg): ...here and... diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h index 7bf8ba3..676b3b7 100644 --- a/gcc/config/h8300/h8300-protos.h +++ b/gcc/config/h8300/h8300-protos.h @@ -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); diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c index b9bc95c..f9bcc74 100644 --- a/gcc/config/h8300/h8300.c +++ b/gcc/config/h8300/h8300.c @@ -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 diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h index 593106b..eb747ed 100644 --- a/gcc/config/h8300/h8300.h +++ b/gcc/config/h8300/h8300.h @@ -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. */ |