Diego Novillo wrote:
<[EMAIL PROTECTED]> wrote:
I am correct in assuming that pretty printing & debug dumping in GCC tend to
go thru the pretty printer abstraction of gcc/pretty-printer.h hence that
the old way of printing directly to a file (like e.g. dump_bb or debug_bb in
gcc/cfg.c for printing basic_block-s) is deprecated, or is it the other way
round (that using pretty-printer.h is deprecated in favor of routines with a
FILE* argument)?
They're orthogonal. The pretty printer uses its own buffering, but
the final target is always a FILE *. All the dump_*() routines are
implemented with a FILE * argument and the debug_*() routines are just
calls to dump_*() with FILE set to stderr.
Do you mean that the trend is to have both dump_* routines (writing to
FILE*) and prettyprinting routines? Except of course the historical
existence of code, I don't understand why both are needed (unless
dumping is outputting in a different way than prettyprinting).
void
pp_construct_routdata (pretty_printer *pp, const char *prefix, int
maximum_length, void (*flushrout)(const char*,void*), void *flushdata)
I would like to avoid using fmemopen; it seems very GNU GLIBC specific...
Using fmemopen is probably the easiest way. Another way would be
adding support in the pretty-printer basic routines to emit to a char
* buffer. It would probably need several changes but I'm not quite
sure how extensive would that be.
I understood that all prettyprinting is systematically using an obstack
as a buffer (actually, I renamed the FILE* field to something else, and
it does not appear a lot).
--
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 mines, sont seulement les miennes} ***