Small modifications. Swapped %n and %N
authorSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Mon, 29 Nov 2004 10:49:45 +0000 (10:49 +0000)
committerSebastian Hack <hack@ipd.info.uni-karlsruhe.de>
Mon, 29 Nov 2004 10:49:45 +0000 (10:49 +0000)
[r4491]

ir/ir/irprintf.c
ir/ir/irprintf.h

index c610b37..8c123f2 100644 (file)
@@ -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;
 
index e471629..841003c 100644 (file)
@@ -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
  * 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