aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-09-15 14:37:28 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-09-15 14:37:28 +0000
commit870118b7f139a2477cd16de9d8539946959c5633 (patch)
tree0f38ba28fa9b8476ec879058ccc6a40b6b2d5bc7 /gcc/doc
parentbb149ca2e912038dce733f95ab1c24ff0d1af280 (diff)
downloadgcc-870118b7f139a2477cd16de9d8539946959c5633.zip
gcc-870118b7f139a2477cd16de9d8539946959c5633.tar.gz
gcc-870118b7f139a2477cd16de9d8539946959c5633.tar.bz2
Turn FUNCTION_ARG_OFFSET into a hook
2017-09-13 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * target.def (function_arg_offset): New hook. * targhooks.h (default_function_arg_offset): Declare. * targhooks.c (default_function_arg_offset): New function. * function.c (locate_and_pad_parm): Use targetm.calls.function_arg_offset instead of FUNCTION_ARG_OFFSET. * doc/tm.texi.in (FUNCTION_ARG_OFFSET): Replace with... (TARGET_FUNCTION_ARG_OFFSET): ...this. * doc/tm.texi: Regenerate. * config/spu/spu.h (FUNCTION_ARG_OFFSET): Delete. * config/spu/spu.c (spu_function_arg_offset): New function. (TARGET_FUNCTION_ARG_OFFSET): Redefine. * system.h (FUNCTION_ARG_OFFSET): Poison. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r252821
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/tm.texi14
-rw-r--r--gcc/doc/tm.texi.in8
2 files changed, 8 insertions, 14 deletions
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 6277e88..ae65e4f 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -4079,13 +4079,13 @@ on the stack. The compiler knows how to track the amount of stack space
used for arguments without any special help.
@end deftypefn
-@defmac FUNCTION_ARG_OFFSET (@var{mode}, @var{type})
-If defined, a C expression that is the number of bytes to add to the
-offset of the argument passed in memory. This is needed for the SPU,
-which passes @code{char} and @code{short} arguments in the preferred
-slot that is in the middle of the quad word instead of starting at the
-top.
-@end defmac
+@deftypefn {Target Hook} HOST_WIDE_INT TARGET_FUNCTION_ARG_OFFSET (machine_mode @var{mode}, const_tree @var{type})
+This hook returns the number of bytes to add to the offset of an
+argument of type @var{type} and mode @var{mode} when passed in memory.
+This is needed for the SPU, which passes @code{char} and @code{short}
+arguments in the preferred slot that is in the middle of the quad word
+instead of starting at the top. The default implementation returns 0.
+@end deftypefn
@deftypefn {Target Hook} pad_direction TARGET_FUNCTION_ARG_PADDING (machine_mode @var{mode}, const_tree @var{type})
This hook determines whether, and in which direction, to pad out
diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in
index c66f8ce..733466d 100644
--- a/gcc/doc/tm.texi.in
+++ b/gcc/doc/tm.texi.in
@@ -3281,13 +3281,7 @@ argument @var{libname} exists for symmetry with
@hook TARGET_FUNCTION_ARG_ADVANCE
-@defmac FUNCTION_ARG_OFFSET (@var{mode}, @var{type})
-If defined, a C expression that is the number of bytes to add to the
-offset of the argument passed in memory. This is needed for the SPU,
-which passes @code{char} and @code{short} arguments in the preferred
-slot that is in the middle of the quad word instead of starting at the
-top.
-@end defmac
+@hook TARGET_FUNCTION_ARG_OFFSET
@hook TARGET_FUNCTION_ARG_PADDING