[MIPS] Hookize FUNCTION_VALUE, LIBCALL_VALUE and FUNCTION_VALUE_REGNO_P

Richard Sandiford rdsandiford@googlemail.com
Wed Mar 23 21:04:00 GMT 2011


Anatoly Sokolov <aesok@post.ru> writes:
> -/* Implement FUNCTION_VALUE and LIBCALL_VALUE.  For normal calls,
> -   VALTYPE is the return type and MODE is VOIDmode.  For libcalls,
> -   VALTYPE is null and MODE is the mode of the return value.  */
> +/* Implement TARGET_FUNCTION_VALUE and TERGET_LIBCALL_VALUE.

typo: TARGET.

> +   For normal calls, VALTYPE is the return type and MODE is VOIDmode.
> +   For libcalls, VALTYPE is null and MODE is the mode of the return value.  */
>  
> -rtx
> -mips_function_value (const_tree valtype, const_tree func, enum machine_mode mode)
> +static rtx
> +mips_function_value_1 (const_tree valtype, const_tree fn_decl_or_type,
> +                      enum machine_mode mode)
>  {
>    if (valtype)
>      {
>        tree fields[2];
>        int unsigned_p;
> +      const_tree func = fn_decl_or_type;
>  
> +      if (fn_decl_or_type
> +         && !DECL_P (fn_decl_or_type))
> +       func = NULL;
> +

Nitlet, but I'd prefer:

      const_tree func;

      if (fn_decl_or_type && DECL_P (fn_decl_or_type))
	func = fn_decl_or_type;
      else
	func = NULL_TREE;

> +   Returns true if N is a possible register number for a function value.
> +   On the MIPS, R2 R3 and F0 F2 are the only register thus used.
> +   Currently, R2 and F0 are only implemented here (C has no complex type)  */

"N" isn't right any more.  Let's just drop that line.  (The rest of
the comment looks dodgy, but that's certainly not your fault. :-)
I agree we should keep the pre-existing comment when doing changes
like this.)

> +mips_function_value_regno_p (const unsigned int regno)

Let's drop the "const".

OK with those changes, thanks.

Richard



More information about the Gcc-patches mailing list