Re: [PATCH 1/8] Refactor disassembly code

Simon Marchi
2017-01-12T15:29:46Z

On 2017-01-12 07:36, Pedro Alves wrote:
> I had written it that way originally because a default parameter forces
> the compiler to pass down an extra parameter (adding to register
> pressure)
> to all call sites, when only a few places actually need the extra
> output parameter. It's like a double-optional -- i.e., the
> parameter can be NULL, so merging doesn't simplify that much,
> given that the version with the single argument does not need to
> check the parameter. I.e., one function can be built on top of the
> other. I see it as a different case from when a parameter is optional
> such that the passed in value always need to be taken in consideration
> by the method implementation, like when passing a flags argument, with
> the default being some flag value (or zero).
>
> But this is not really performance critical code, so if you
> want to change it, I don't mind.

Ok, I hadn't gone that far in my reflexion, I thought it was simply a
convenience thing.