This is the mail archive of the
mailing list for the GCC project.
Re: [cxx-conversion] RFC - Helper types for building GIMPLE
On Thu, Mar 14, 2013 at 10:54 AM, Richard Biener <email@example.com> wrote:
> Xinliang David Li <firstname.lastname@example.org> wrote:
>>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.
> That won't work with the magic in the builder to create ssa names for the results. Then people need to think about cfg merges and phi nodes. So much for labels and gotos...
> I'd rather have people know about the context they are working in. Otherwise they cannot exploit its property either.
I am not sure what you mean. The builder helper class should contain
all the context information which should be accessible if user wants
to take a peek. The low level information is usually needed for
analysis, but not needs to be exposed for transformation.
>>On Thu, Mar 14, 2013 at 4:25 AM, Michael Matz <email@example.com> 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
>>> 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
>>> instead of improving the current interface. IOW I don't like it