X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firprintf.h;h=9abd396a17114fca6ec52b3a2eabe31c512e4959;hb=8399216d8aebc713bbda04b6e3e250a1d52b20bf;hp=d2b9ebde0b020e2b876a28f936dca6e862bcf53f;hpb=16d930945862898c2e4ef1cc537bd228d4f5b7b4;p=libfirm diff --git a/ir/ir/irprintf.h b/ir/ir/irprintf.h index d2b9ebde0..9abd396a1 100644 --- a/ir/ir/irprintf.h +++ b/ir/ir/irprintf.h @@ -20,10 +20,18 @@ #ifndef _IRPRINTF_H #define _IRPRINTF_H +#include +#include +#include + +/* forward definition */ +struct obstack; + /** * Something that can append strings and chars to something. */ typedef struct _appender_t { + void (*init)(void *object, size_t n); void (*append_char)(void *object, size_t n, char ch); void (*append_str)(void *object, size_t n, const char *str); } appender_t; @@ -46,14 +54,16 @@ typedef void (ir_printf_cb_t)(const appender_t *app, void *object, size_t limit, * - @%p A pointer. * - @%s A string. * - @%I An ident. + * - @%t A type name. * - @%e An entity name. - * - @%E An entity ld_name. + * - @%E An entity ld name. * - @%n A full description of a node. - * - @%o The opcode name of an ir node. + * - @%O The opcode name of an ir node. * - @%m The mode name of an ir mode. * - @%N The node number of an ir node. - * - @%b The block node number of the nodes block. - * - @%t A tarval. + * - @%B The block node number of the nodes block. + * - @%b A bitset. + * - @%T A tarval. * * Each of these can be prepended by a '+' which means, that the given * pointer is a collection of items specified by the format. In this @@ -63,7 +73,7 @@ typedef void (ir_printf_cb_t)(const appender_t *app, void *object, size_t limit, * @code * pset *nodes; * ... - * ir_printf("Some nodes: %+n\n", it_pset, nodes); + * ir_printf("Some nodes: %*n\n", it_pset, nodes); * @endcode * The @c it_pset is an iterator interface (of type * @c iterator_t that allows the dumper to traverse the set. @@ -84,7 +94,7 @@ typedef void (ir_printf_cb_t)(const appender_t *app, void *object, size_t limit, * ... * pset *xyzs; * - * ir_printf("A set of xyz\'s: %+C\n", it_pset, xyzs, xyz_dump); + * ir_printf("A set of xyz\'s: %*C\n", it_pset, xyzs, xyz_dump); * @endcode * * @param fmt The format string. @@ -101,16 +111,24 @@ void ir_fprintf(FILE *f, const char *fmt, ...); */ void ir_snprintf(char *buf, size_t n, const char *fmt, ...); -#ifdef DEBUG_libfirm - -#define ir_debugf(p) ir_printf p -#define ir_fdebugf(p) ir_fprintf p +/** + * @see irn_printf. + */ +void ir_vprintf(const char *fmt, va_list args); -#else +/** + * @see irn_printf. + */ +void ir_vfprintf(FILE *f, const char *fmt, va_list args); -#define ir_debugf(p) -#define ir_fdebugf(p) +/** + * @see irn_printf. + */ +void ir_vsnprintf(char *buf, size_t len, const char *fmt, va_list args); -#endif +/** + * @see irn_printf. + */ +void ir_obst_vprintf(struct obstack *obst, const char *fmt, va_list args); #endif