diff options
author | froydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-29 12:24:04 +0000 |
---|---|---|
committer | froydnj <froydnj@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-29 12:24:04 +0000 |
commit | f387af4f9ece169d3a4e18453d6d0978cf4268cd (patch) | |
tree | 2a6f923525a191cb71e15517c9b90794e223784f /gcc/calls.c | |
parent | 5cd86571c70d9a80880fb9611315ea89ca78bd5d (diff) | |
download | gcc-f387af4f9ece169d3a4e18453d6d0978cf4268cd.tar.gz |
* calls.c, dse.c, expr.c, function.c: Call targetm.calls.function_arg,
targetm.calls.function_incoming_arg, and
targetm.calls.function_arg_advance instead of FUNCTION_ARG,
FUNCTION_INCOMING_ARG, and FUNCTION_ARG_ADVANCE, respectively.
* target.h (struct gcc_target): Add function_arg_advance,
function_arg, and function_incoming_arg fields.
* target-def.h (TARGET_FUNCTION_ARG_ADVANCE, TARGET_FUNCTION_ARG):
(TARGET_FUNCTION_INCOMING_ARG): Define.
(TARGET_CALLS): Add TARGET_FUNCTION_ARG_ADVANCE, TARGET_FUNCTION_ARG,
and TARGET_FUNCTION_INCOMING_ARG.
* targhooks.h (default_function_arg_advance): Declare.
(default_function_arg, default_function_incoming_arg): Declare.
* targhooks.c (default_function_arg_advance): New function.
(default_function_arg, default_function_incoming_arg): New function.
* config/i386/i386.c (function_arg_advance): Rename to...
(ix86_function_arg_advance): ...this. Make static.
(function_arg): Rename to...
(ix86_function_arg): ...this. Make static.
(TARGET_FUNCTION_ARG_ADVANCE): Define.
(TARGET_FUNCTION_ARG): Define.
* config/i386/i386.h (FUNCTION_ARG_ADVANCE): Delete.
(FUNCTION_ARG): Delete.
* config/i386/i386-protos.h (function_arg_advance): Delete prototype.
(function_arg): Delete prototype.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161530 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/calls.c')
-rw-r--r-- | gcc/calls.c | 49 |
1 files changed, 27 insertions, 22 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index c6d4706733a..3b06ad397de 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -228,7 +228,7 @@ prepare_call_address (tree fndecl, rtx funexp, rtx static_chain_value, It is zero if this call doesn't want a structure value. NEXT_ARG_REG is the rtx that results from executing - FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1) + targetm.calls.function_arg (&args_so_far, VOIDmode, void_type_node, true) just after all the args have had their registers assigned. This could be whatever you like, but normally it is the first arg-register beyond those used for args in this call, @@ -1127,17 +1127,18 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, args[i].unsignedp = unsignedp; args[i].mode = mode; - args[i].reg = FUNCTION_ARG (*args_so_far, mode, type, - argpos < n_named_args); -#ifdef FUNCTION_INCOMING_ARG + args[i].reg = targetm.calls.function_arg (args_so_far, mode, type, + argpos < n_named_args); + /* If this is a sibling call and the machine has register windows, the register window has to be unwinded before calling the routine, so arguments have to go into the incoming registers. */ - args[i].tail_call_reg = FUNCTION_INCOMING_ARG (*args_so_far, mode, type, - argpos < n_named_args); -#else - args[i].tail_call_reg = args[i].reg; -#endif + if (targetm.calls.function_incoming_arg != targetm.calls.function_arg) + args[i].tail_call_reg + = targetm.calls.function_incoming_arg (args_so_far, mode, type, + argpos < n_named_args); + else + args[i].tail_call_reg = args[i].reg; if (args[i].reg) args[i].partial @@ -1192,8 +1193,8 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED, /* Increment ARGS_SO_FAR, which has info about which arg-registers have been used, etc. */ - FUNCTION_ARG_ADVANCE (*args_so_far, TYPE_MODE (type), type, - argpos < n_named_args); + targetm.calls.function_arg_advance (args_so_far, TYPE_MODE (type), + type, argpos < n_named_args); } } @@ -2828,14 +2829,15 @@ expand_call (tree exp, rtx target, int ignore) /* Set up next argument register. For sibling calls on machines with register windows this should be the incoming register. */ -#ifdef FUNCTION_INCOMING_ARG if (pass == 0) - next_arg_reg = FUNCTION_INCOMING_ARG (args_so_far, VOIDmode, - void_type_node, 1); + next_arg_reg = targetm.calls.function_incoming_arg (&args_so_far, + VOIDmode, + void_type_node, + true); else -#endif - next_arg_reg = FUNCTION_ARG (args_so_far, VOIDmode, - void_type_node, 1); + next_arg_reg = targetm.calls.function_arg (&args_so_far, + VOIDmode, void_type_node, + true); /* All arguments and registers used for the call must be set up by now! */ @@ -3422,7 +3424,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, argvec[count].mode = Pmode; argvec[count].partial = 0; - argvec[count].reg = FUNCTION_ARG (args_so_far, Pmode, NULL_TREE, 1); + argvec[count].reg = targetm.calls.function_arg (&args_so_far, + Pmode, NULL_TREE, true); gcc_assert (targetm.calls.arg_partial_bytes (&args_so_far, Pmode, NULL_TREE, 1) == 0); @@ -3438,7 +3441,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, || reg_parm_stack_space > 0) args_size.constant += argvec[count].locate.size.constant; - FUNCTION_ARG_ADVANCE (args_so_far, Pmode, (tree) 0, 1); + targetm.calls.function_arg_advance (&args_so_far, Pmode, (tree) 0, true); count++; } @@ -3497,7 +3500,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, argvec[count].value = val; argvec[count].mode = mode; - argvec[count].reg = FUNCTION_ARG (args_so_far, mode, NULL_TREE, 1); + argvec[count].reg = targetm.calls.function_arg (&args_so_far, mode, + NULL_TREE, true); argvec[count].partial = targetm.calls.arg_partial_bytes (&args_so_far, mode, NULL_TREE, 1); @@ -3517,7 +3521,7 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, || reg_parm_stack_space > 0) args_size.constant += argvec[count].locate.size.constant; - FUNCTION_ARG_ADVANCE (args_so_far, mode, (tree) 0, 1); + targetm.calls.function_arg_advance (&args_so_far, mode, (tree) 0, true); } /* If this machine requires an external definition for library @@ -3826,7 +3830,8 @@ emit_library_call_value_1 (int retval, rtx orgfun, rtx value, build_function_type (tfom, NULL_TREE), original_args_size.constant, args_size.constant, struct_value_size, - FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1), + targetm.calls.function_arg (&args_so_far, + VOIDmode, void_type_node, true), valreg, old_inhibit_defer_pop + 1, call_fusage, flags, & args_so_far); |