On Wed, Jun 1, 2011 at 2:12 PM, Basile Starynkevitch <bas...@starynkevitch.net> wrote: > On Wed, 1 Jun 2011 13:26:24 -0700 > Xinliang David Li <davi...@google.com> wrote: > >> Hi, this is a simple patch that support dump_before flag. E.g, >> >> -fdump-tree-pre-before >> >> This is useful for diffing the the IR before and after a pass. > > Perhaps you forgot to actually attach the patch?
Right -- attached in a follow up email. > >> Gcc dumping needs more cleanups -- such as allowing IR only dump, >> allowing IR dumping for a particular function etc. The exposure of >> 'dumpfile' (instead of a dumping_level () function) makes those change >> a little messy, but can be done. > > I don't understand what you mean by a dumping_level () function. What > should that hypothetical function do? (I'm wrongly guessing it would > return an integer, but IIRC dumpfile is a FILE*) THere are two sources of dump: 1) IR dump performed by pass manager 2) pass specific debugging dump (the verbosity is controlled by -details flag). 2) is the part that is messy and needs cleanup. Every pass just checks if dump_file is null or not and decide to dump the debugging info -- there is no easy way to turn it on and off. Ideally, individual pass should call int debug_dump_level () -- dumps when it returns > 0. With that in place, the dump flag -fdump-xxx-yyy-ir_only can be easily implemented -- it only turns on pass manager dump, but lowers the debug dump level to 0. David > > Regards > > -- > Basile STARYNKEVITCH http://starynkevitch.net/Basile/ > email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 > 8, rue de la Faiencerie, 92340 Bourg La Reine, France > *** opinions {are only mine, sont seulement les miennes} *** >