On Mon, Nov 19, 2012 at 5:18 AM, Martin Jambor <mjam...@suse.cz> wrote:
> Hi,
>
> On Fri, Nov 16, 2012 at 08:08:52AM -0500, Diego Novillo wrote:
>> On Fri, Nov 16, 2012 at 4:38 AM, Martin Jambor <mjam...@suse.cz> wrote:
>>
>> > So you do not plan to replace/rename at least some of them?  This
>> > seems like unnecessary and confusing layering just to avoid the work
>> > to do the right thing.
>>
>> No, we plan to replace all the existing dumping routines.  We are just
>> not planning to add *new* ones.  Duplicating the existing routines
>> would indeed be useless.
>>
>> >>
>> >> dump_raw
>> >>
>> >>     This function overload set provides the raw oriented dump,
>> >>     e.g. a tuple.
>> >
>> > I'm not sure I understand the whole raw thing.
>>
>> This is to distinguish between:
>>
>> a = b + c;
>>
>> from
>>
>> <modify_expr, plus_expr, a, b, c>
>>
>> ASTs and RTL have something similar.  The raw output gives you a
>> different view.  Not every data structure will have that distinction.
>>
>>
>> > I'm afraid we can't really always rely on overloading.  For example,
>> > even though I often use debug_tree to examine a tree, probably even
>> > more often I just use debug_generic_expr.  When I write stuff into a
>> > dump file, I rarely ever use the verbose variants but I certainly want
>> > them to exist.  And there might be other similar cases, like the
>> > .*_brief dumping functions that are sometimes also used.
>>
>> Sure.  The idea is to provide these variants via symbolic TDF_ style
>> flags.  For combinations that are very popular, we provide alternate
>> entry names so that you don't have to be specifying the flags all the
>> time.
>
> Well, this is what I was actually afraid of.  If things like generic
> or tree dump of a tree value is selected by new TDF_ flags, then you
> are in danger of just replacing current mess in function names by a
> mess of constants.

No, that's not so.  Combinations of flags that are very popular will
have named entry points.  Additionally, the functions you mention
(dump_generic, dump_tree and dump_function) are actually three
"different" data structures (at least at the conceptual level, since
they are all trees), so they remain different entry points.

The TDF_* flags are always going to be modifiers that alter the
flavour of a given data structure, they are not selectors of different
concepts that happen to use the same data structure.

> Moreover, would the TDF_ constants be available in gdb?  IIRC hen I
> use them from gdb, I always have to pass numbers.

Absolutely.  I also dislike having to use numbers.


Diego.

Reply via email to