[PATCH] recog: Use parameter packs for operator()
Jeff Law
law@redhat.com
Tue Jun 9 20:22:43 GMT 2020
On Tue, 2020-06-02 at 15:00 +0100, Richard Sandiford wrote:
> This patch uses parameter packs to define insn_gen_fn::operator().
> I guess in some ways it's C++-ification for its own sake, but it does
> make things simpler and removes the current artificial limit of 16
> arguments.
>
> Note that the call is still strongly typed: all arguments have to have
> implicit conversions to rtx. Error messages for bad arguments look
> reasonable.
>
> I'm sure there are more elegant ways of getting the function type,
> but this version at least fits on one line, so I didn't try too
> hard to find an alternative.
>
> Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK to install?
>
> Richard
>
>
> 2020-06-02 Richard Sandiford <richard.sandiford@arm.com>
>
> gcc/
> * recog.h (insn_gen_fn::f0, insn_gen_fn::f1, insn_gen_fn::f2)
> (insn_gen_fn::f3, insn_gen_fn::f4, insn_gen_fn::f5, insn_gen_fn::f6)
> (insn_gen_fn::f7, insn_gen_fn::f8, insn_gen_fn::f9, insn_gen_fn::f10)
> (insn_gen_fn::f11, insn_gen_fn::f12, insn_gen_fn::f13)
> (insn_gen_fn::f14, insn_gen_fn::f15, insn_gen_fn::f16): Delete.
> (insn_gen_fn::operator()): Replace overloaded definitions with
> a parameter-pack version.
OK.
Jeff
>
More information about the Gcc-patches
mailing list