iq2000-protos.h (function_arg): Delete.
authorNathan Froyd <froydnj@codesourcery.com>
Thu, 28 Oct 2010 19:52:48 +0000 (19:52 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Thu, 28 Oct 2010 19:52:48 +0000 (19:52 +0000)
* 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

gcc/ChangeLog
gcc/config/iq2000/iq2000-protos.h
gcc/config/iq2000/iq2000.c
gcc/config/iq2000/iq2000.h

index e8737d401554636621322f62415725494f651468..daae755efa21d2df870aa7cad9d886f6cdce36d0 100644 (file)
@@ -1,3 +1,19 @@
+2010-10-28  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * 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.
+
 2010-10-28  Nathan Froyd  <froydnj@codesourcery.com>
 
        * config/fr30/fr30-protos.h (fr30_num_arg_regs): Delete.
index 971aadf4547c9833dd872a4032a6979c216fd8a9..067e80747d1b76bccc74c21b7a05b10f21109d17 100644 (file)
@@ -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
 
index f6caf6084a16129bc54b16a5175f847c04d22c00..5661fd4eb8f5d874ed1f56a9a3511463952bd176 100644 (file)
@@ -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;
      }
 
index 91c5173416d6839bd35c6ee2efb6eccd4fc59c97..716be5b7a671b9692de083c38069bb09b7c0c082 100644 (file)
@@ -359,9 +359,6 @@ enum reg_class
 \f
 /* 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                                                            \