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. I'd much rather have functions dump_generic, dump_tree (and dump_function!), with consistent parameters, for the three very different dumps than TDF_gimple, TDF_tree and TDF_function constants which would do some sort of second level function overloading. I understand my approach would not be a real grand unification, but I believe that either way we'll have to remember a few identifiers to make dumping useful. Yes, there is a lot of space for simplification so that we need to remember fewer and the parameters should be made much more consistent but I think this is not the place where overloading-only is appropriate for many uses. Moreover, would the TDF_ constants be available in gdb? IIRC hen I use them from gdb, I always have to pass numbers. Thanks, Martin > > > > Nevertheless, it would be great if we had fewer and consistent names > > of dumping functions, even though perhaps not just three. It would > > also be nice if all the file variants had an integer indent parameter > > ;-) > > Ah, good idea. Thanks. > > > Diego.