aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/iq2000
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-10-28 19:52:48 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-10-28 19:52:48 +0000
commit24ef86d7ad359cbe86946ce7cbebe151169909c1 (patch)
tree41217902b7f925527c7b76b72bc7bd67491b504c /gcc/config/iq2000
parentb60613c38a1b83f9abd69278dcc351647161e747 (diff)
downloadgcc-24ef86d7ad359cbe86946ce7cbebe151169909c1.zip
gcc-24ef86d7ad359cbe86946ce7cbebe151169909c1.tar.gz
gcc-24ef86d7ad359cbe86946ce7cbebe151169909c1.tar.bz2
iq2000-protos.h (function_arg): Delete.
* config/iq2000/iq2000-protos.h (function_arg): Delete. (function_arg_advance): Delete. * config/iq2000/iq2000.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete. * config/iq2000/iq2000.c (function_arg): Rename to... (iq2000_function_arg): ...this. Make static. Take a const_tree and a bool. (function_arg_advance): Rename to... (iq2000_function_arg_advance): ...this. Make static. Take a const_tree and a bool. (iq2000_expand_prologue): Call iq2000_function_arg_advance and iq2000_function_arg. (iq2000_pass_by_reference): Call iq2000_function_arg). (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define. From-SVN: r166035
Diffstat (limited to 'gcc/config/iq2000')
-rw-r--r--gcc/config/iq2000/iq2000-protos.h2
-rw-r--r--gcc/config/iq2000/iq2000.c37
-rw-r--r--gcc/config/iq2000/iq2000.h6
3 files changed, 24 insertions, 21 deletions
diff --git a/gcc/config/iq2000/iq2000-protos.h b/gcc/config/iq2000/iq2000-protos.h
index 971aadf..067e807 100644
--- a/gcc/config/iq2000/iq2000-protos.h
+++ b/gcc/config/iq2000/iq2000-protos.h
@@ -42,8 +42,6 @@ extern void gen_conditional_branch (rtx *, enum machine_mode);
#ifdef TREE_CODE
extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx);
-extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
-extern struct rtx_def * function_arg (CUMULATIVE_ARGS *, enum machine_mode, const_tree, int);
extern bool iq2000_function_value_regno_p (const unsigned int);
#endif
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index f6caf60..5661fd4 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -164,6 +164,10 @@ static bool iq2000_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool);
static int iq2000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
+static rtx iq2000_function_arg (CUMULATIVE_ARGS *,
+ enum machine_mode, const_tree, bool);
+static void iq2000_function_arg_advance (CUMULATIVE_ARGS *,
+ enum machine_mode, const_tree, bool);
static void iq2000_va_start (tree, rtx);
static bool iq2000_legitimate_address_p (enum machine_mode, rtx, bool);
static bool iq2000_can_eliminate (const int, const int);
@@ -233,6 +237,10 @@ static const struct default_options iq2000_option_optimization_table[] =
#define TARGET_CALLEE_COPIES hook_callee_copies_named
#undef TARGET_ARG_PARTIAL_BYTES
#define TARGET_ARG_PARTIAL_BYTES iq2000_arg_partial_bytes
+#undef TARGET_FUNCTION_ARG
+#define TARGET_FUNCTION_ARG iq2000_function_arg
+#undef TARGET_FUNCTION_ARG_ADVANCE
+#define TARGET_FUNCTION_ARG_ADVANCE iq2000_function_arg_advance
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS iq2000_setup_incoming_varargs
@@ -1132,9 +1140,9 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
/* Advance the argument of type TYPE and mode MODE to the next argument
position in CUM. */
-void
-function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
- int named)
+static void
+iq2000_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named)
{
if (TARGET_DEBUG_D_MODE)
{
@@ -1201,9 +1209,9 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
/* Return an RTL expression containing the register for the given mode MODE
and type TYPE in CUM, or 0 if the argument is to be passed on the stack. */
-struct rtx_def *
-function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, const_tree type,
- int named)
+static rtx
+iq2000_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ const_tree type, bool named)
{
rtx ret;
int regbase = -1;
@@ -1939,9 +1947,11 @@ iq2000_expand_prologue (void)
passed_mode = Pmode;
}
- entry_parm = FUNCTION_ARG (args_so_far, passed_mode, passed_type, 1);
+ entry_parm = iq2000_function_arg (&args_so_far, passed_mode,
+ passed_type, true);
- FUNCTION_ARG_ADVANCE (args_so_far, passed_mode, passed_type, 1);
+ iq2000_function_arg_advance (&args_so_far, passed_mode,
+ passed_type, true);
next_arg = DECL_CHAIN (cur_arg);
if (entry_parm && store_args_on_stack)
@@ -1980,10 +1990,11 @@ iq2000_expand_prologue (void)
/* In order to pass small structures by value in registers we need to
shift the value into the high part of the register.
- Function_arg has encoded a PARALLEL rtx, holding a vector of
- adjustments to be made as the next_arg_reg variable, so we split up the
- insns, and emit them separately. */
- next_arg_reg = FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1);
+ iq2000_unction_arg has encoded a PARALLEL rtx, holding a vector of
+ adjustments to be made as the next_arg_reg variable, so we split up
+ the insns, and emit them separately. */
+ next_arg_reg = iq2000_function_arg (&args_so_far, VOIDmode,
+ void_type_node, true);
if (next_arg_reg != 0 && GET_CODE (next_arg_reg) == PARALLEL)
{
rtvec adjust = XVEC (next_arg_reg, 0);
@@ -2293,7 +2304,7 @@ iq2000_pass_by_reference (CUMULATIVE_ARGS *cum, enum machine_mode mode,
CUMULATIVE_ARGS temp;
temp = *cum;
- if (FUNCTION_ARG (temp, mode, type, named) != 0)
+ if (iq2000_function_arg (&temp, mode, type, named) != 0)
return 1;
}
diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h
index 91c5173..716be5b7 100644
--- a/gcc/config/iq2000/iq2000.h
+++ b/gcc/config/iq2000/iq2000.h
@@ -359,9 +359,6 @@ enum reg_class
/* Function Arguments in Registers. */
-#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
- function_arg (& CUM, MODE, TYPE, NAMED)
-
#define MAX_ARGS_IN_REGISTERS 8
typedef struct iq2000_args
@@ -383,9 +380,6 @@ typedef struct iq2000_args
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
init_cumulative_args (& CUM, FNTYPE, LIBNAME) \
-#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
- function_arg_advance (& CUM, MODE, TYPE, NAMED)
-
#define FUNCTION_ARG_PADDING(MODE, TYPE) \
(! BYTES_BIG_ENDIAN \
? upward \