This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] beat location sense into fold (PR/40435)


2009/7/9 Aldy Hernandez <aldyh@redhat.com>:
>>
>> ?bool
>> -fold_builtin_next_arg (tree exp, bool va_start_p)
>> +fold_builtin_next_arg (location_t loc ATTRIBUTE_UNUSED,
>> + ? ? ? ? ? ? ? ? ? ?tree exp, bool va_start_p)
>> ?{
>> ? ?tree fntype = TREE_TYPE (current_function_decl);
>> ? ?int nargs = call_expr_nargs (exp);
>> @@ -11995,7 +12086,8 @@ fold_builtin_next_arg (tree exp, bool va
>>
>> The loc is indeed never used, so why bother? This occurs at least twice.
>
> There are a gazillion functions in builtins.c that take a location and
> are called fold_builtin_*. ?It would be very confusing to have 90
> functions take an argument, but 3 not have it.

I am sorry but in my version of the patch I disagree with this. For
two reasons mainly:

* It makes the patch smaller. I would have tried to do a patch like
this as incrementally as possible. So if anyone wants to add unused
location_t arguments to all fold functions, this can be done in a
trivial follow-up patch.
* The fold_builtin_* functions already have way different arguments,
so one needs to look at the declaration anyway. I don't see why
location_t has to be a special case.

Cheers,

Manuel.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]