Ian Romanick <i...@freedesktop.org> writes:

> On 10/01/2013 07:15 PM, Francisco Jerez wrote:
>>[..]
>> +ir_call *
>> +call(ir_function *f, ir_variable *ret, int num_params, ...)
>
> varargs functions that take an explicit count are very susceptible to
> copy-and-past bugs.  If you copy-and-paste an invocation, add or remove
> a parameter, and forget to change the count, you will be sad.
>
> If possible, I'd much rather see some sort of sentinel to terminate the
> list.  I haven't looked to see how ugly that would be in this case.
> What do you think?
>
Yeah, I'm not especially fond of this parameter arrangement either, I
chose it to match the prototype of builtin_builder::new_sig(), but now I
think it would be a better idea to take the function call arguments as a
linked list of ir_variables.  That's likely to be even more annoying
than variadic parameters in the general case, but it turns out it would
be cleaner for the needs of the builtin builder.

I think I'm just going to make it a local helper function in
builtin_functions.cpp.

Thanks.

Attachment: pgpBgLUnQIWJu.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to