+2010-09-01 Nathan Froyd <froydnj@codesourcery.com>
+
+ * config/m32c/m32c-protos.h (m32c_function_arg): Delete.
+ (m32c_function_arg_advance): Delete.
+ * config/m32c/m32c.h (FUNCTION_ARG, FUNCTION_ARG_ADVANCE): Delete.
+ * config/m32c/m32c.c (m32c_function_arg): Make static. Adjust
+ comments. Take a const_tree and a bool. Declare.
+ (m32c_function_arg_advance): Likewise.
+ (TARGET_FUNCTION_ARG, TARGET_FUNCTION_ARG_ADVANCE): Define.
+
2010-09-01 Uros Bizjak <ubizjak@gmail.com>
PR target/45476
int m32c_trampoline_alignment (void);
int m32c_trampoline_size (void);
-#if defined(RTX_CODE) && defined(TREE_CODE)
-
-rtx m32c_function_arg (CUMULATIVE_ARGS *, MM, tree, int);
-
-#endif
-
#ifdef RTX_CODE
int m32c_cannot_change_mode_class (MM, MM, int);
#ifdef TREE_CODE
-void m32c_function_arg_advance (CUMULATIVE_ARGS *, MM, tree, int);
tree m32c_gimplify_va_arg_expr (tree, tree, gimple_seq *, gimple_seq *);
void m32c_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree, int);
bool m32c_promote_function_return (const_tree);
static struct machine_function *m32c_init_machine_status (void);
static void m32c_insert_attributes (tree, tree *);
static bool m32c_legitimate_address_p (enum machine_mode, rtx, bool);
+static rtx m32_function_arg (CUMULATIVE_ARGS *, enum machine_mode
+ const_tree, bool);
static bool m32c_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
const_tree, bool);
+static void m32c_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
+ const_tree, bool);
static bool m32c_promote_prototypes (const_tree);
static int m32c_pushm_popm (Push_Pop_Type);
static bool m32c_strict_argument_naming (CUMULATIVE_ARGS *);
/* Passing Arguments in Registers */
-/* Implements FUNCTION_ARG. Arguments are passed partly in registers,
- partly on stack. If our function returns a struct, a pointer to a
- buffer for it is at the top of the stack (last thing pushed). The
- first few real arguments may be in registers as follows:
+/* Implements TARGET_FUNCTION_ARG. Arguments are passed partly in
+ registers, partly on stack. If our function returns a struct, a
+ pointer to a buffer for it is at the top of the stack (last thing
+ pushed). The first few real arguments may be in registers as
+ follows:
R8C/M16C: arg1 in r1 if it's QI or HI (else it's pushed on stack)
arg2 in r2 if it's HI (else pushed on stack)
Note that when arg1 doesn't fit in r1, arg2 may still be passed in
r2 if it fits. */
-rtx
+#undef TARGET_FUNCTION_ARG
+#define TARGET_FUNCTION_ARG m32c_function_arg
+static rtx
m32c_function_arg (CUMULATIVE_ARGS * ca,
- enum machine_mode mode, tree type, int named)
+ enum machine_mode mode, const_tree type, bool named)
{
/* Can return a reg, parallel, or 0 for stack */
rtx rv = NULL_RTX;
ca->parm_num = 1;
}
-/* Implements FUNCTION_ARG_ADVANCE. force_mem is set for functions
- returning structures, so we always reset that. Otherwise, we only
- need to know the sequence number of the argument to know what to do
- with it. */
-void
+/* Implements TARGET_FUNCTION_ARG_ADVANCE. force_mem is set for
+ functions returning structures, so we always reset that. Otherwise,
+ we only need to know the sequence number of the argument to know what
+ to do with it. */
+#undef TARGET_FUNCTION_ARG_ADVANCE
+#define TARGET_FUNCTION_ARG_ADVANCE m32c_function_arg_advance
+static void
m32c_function_arg_advance (CUMULATIVE_ARGS * ca,
enum machine_mode mode ATTRIBUTE_UNUSED,
- tree type ATTRIBUTE_UNUSED,
- int named ATTRIBUTE_UNUSED)
+ const_tree type ATTRIBUTE_UNUSED,
+ bool named ATTRIBUTE_UNUSED)
{
if (ca->force_mem)
ca->force_mem = 0;
/* Passing Arguments in Registers */
-#define FUNCTION_ARG(CA,MODE,TYPE,NAMED) \
- m32c_function_arg (&(CA),MODE,TYPE,NAMED)
-
typedef struct m32c_cumulative_args
{
/* For address of return value buffer (structures are returned by
#define CUMULATIVE_ARGS m32c_cumulative_args
#define INIT_CUMULATIVE_ARGS(CA,FNTYPE,LIBNAME,FNDECL,N_NAMED_ARGS) \
m32c_init_cumulative_args (&(CA),FNTYPE,LIBNAME,FNDECL,N_NAMED_ARGS)
-#define FUNCTION_ARG_ADVANCE(CA,MODE,TYPE,NAMED) \
- m32c_function_arg_advance (&(CA),MODE,TYPE,NAMED)
#define FUNCTION_ARG_BOUNDARY(MODE,TYPE) (TARGET_A16 ? 8 : 16)
#define FUNCTION_ARG_REGNO_P(r) m32c_function_arg_regno_p (r)