This is the mail archive of the
mailing list for the GCC project.
Re: [cxx-conversion] RFC - Helper types for building GIMPLE
- From: Xinliang David Li <davidxl at google dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: Diego Novillo <dnovillo at google dot com>, gcc-patches at gcc dot gnu dot org, Lawrence Crowl <crowl at google dot com>, Richard Biener <rguenther at suse dot de>
- Date: Thu, 14 Mar 2013 09:17:14 -0700
- Subject: Re: [cxx-conversion] RFC - Helper types for building GIMPLE
- References: <20130313215516.GA29289@google.com> <alpine.LNX.email@example.com>
I am with you for simple cases where straightline code is generated.
Helper class will be very useful when control flow manipulation is
involved. People can simply just write 'straight line like code'
using gimple_label, goto_label etc without worrying about how split
blocks and create new cfg edges. The 'end/finalize' method of the
builder helper will do the magic.
On Thu, Mar 14, 2013 at 4:25 AM, Michael Matz <firstname.lastname@example.org> wrote:
> On Wed, 13 Mar 2013, Diego Novillo wrote:
>> To use the builder:
>> 1- Declare an instance 'gb' of gimple_builder_normal or
>> gimple_builder_ssa. E.g., gimple_builder_ssa gb;
>> 2- Use gb.add_* to add a new statement to it. This
>> returns an SSA name or VAR_DECL with the value of the added
>> 3- Call gb.insert_*() to insert the sequence of statements in the
>> builder into a statement iterator.
> I'm reiterating everything I said in
> Actually your interface now is worse than what Lawrence proposed back in
> November in that the add_* methods return a tree, instead of a gimple
> I haven't seen any convincing reason why the builder class is necessary,
> instead of improving the current interface. IOW I don't like it much.