From: Sebastian Hack Date: Mon, 29 Nov 2004 10:49:45 +0000 (+0000) Subject: Small modifications. Swapped %n and %N X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=fc7e44183102c47e31152fc136a35034c1820873;p=libfirm Small modifications. Swapped %n and %N [r4491] --- diff --git a/ir/ir/irprintf.c b/ir/ir/irprintf.c index c610b379e..8c123f279 100644 --- a/ir/ir/irprintf.c +++ b/ir/ir/irprintf.c @@ -100,7 +100,7 @@ static void ir_common_vprintf(const appender_t *app, void *subject, tarval_snprintf(buf, sizeof(buf), va_arg(args, tarval *)); break; - case 'N': + case 'n': { ir_node *irn = va_arg(args, ir_node *); snprintf(buf, sizeof(buf), "%s%s:%ld", @@ -112,7 +112,7 @@ static void ir_common_vprintf(const appender_t *app, void *subject, DUMP_STR(get_irn_opname(va_arg(args, ir_node *))); break; - case 'n': + case 'N': snprintf(buf, sizeof(buf), "%ld", get_irn_node_nr(va_arg(args, ir_node *))); break; diff --git a/ir/ir/irprintf.h b/ir/ir/irprintf.h index e471629d6..841003c8e 100644 --- a/ir/ir/irprintf.h +++ b/ir/ir/irprintf.h @@ -7,6 +7,8 @@ #ifndef _IRPRINTF_H #define _IRPRINTF_H +#include "config.h" + /** * A string formatting routine for ir nodes. * This function rudimentarily implements a kind of printf(3) for ir @@ -14,10 +16,10 @@ * width specifiers are accepted. * - %p A pointer. * - %s A string. - * - %N A full description of a node. + * - %n A full description of a 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. + * - %N The node number of an ir node. * - %b The block node number of the nodes block. * - %t A tarval. * @@ -35,4 +37,26 @@ 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 ir_printf +#define ir_fdebugf ir_fprintf +#define ir_sndebugf ir_snprintf + +#else + +static INLINE void ir_debugf(const char *fmt, ...) +{ +} + +static INLINE void ir_fdebugf(FILE *, const char *fmt, ...) +{ +} + +static INLINE void ir_sndebugf(char *buf, size_t n, const char *fmt, ...) +{ +} + +#endif + #endif