if a node is a Const, dump it's tarval
typos fixed
[r6133]
* Modified by:
* Created:
* CVS-ID: $Id$
* Modified by:
* Created:
* CVS-ID: $Id$
- * Copyright: (c) 1998-2005 Universit�t Karlsruhe
+ * Copyright: (c) 1998-2005 Universitaet Karlsruhe
* Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/
* Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
*/
snprintf(buf, sizeof(buf), "%ld", get_irn_node_nr(X));
break;
default:
snprintf(buf, sizeof(buf), "%ld", get_irn_node_nr(X));
break;
default:
- snprintf(buf, sizeof(buf), "%s%s%s", A("irn"), get_irn_opname(X),
+ if (is_Const(irn)) {
+ char tbuf[128];
+ tarval_snprintf(tv, sizeof(tv), X);
+ snprintf(buf, sizeof(buf), "%s%s%s<%s>", A("irn"), get_irn_opname(X),
+ get_mode_name(get_irn_mode(X)), tbuf);
+ }
+ else
+ snprintf(buf, sizeof(buf), "%s%s%s", A("irn"), get_irn_opname(X),
get_mode_name(get_irn_mode(X)));
snprintf(add, sizeof(add), "[%ld]", get_irn_node_nr(X));
}
get_mode_name(get_irn_mode(X)));
snprintf(add, sizeof(add), "[%ld]", get_irn_node_nr(X));
}
return arg_append(app, occ, p, strlen(p));
}
return arg_append(app, occ, p, strlen(p));
}
+/**
+ * Emit pnc.
+ */
+static int firm_emit_pnc(appendable_t *app, const arg_occ_t *occ, const arg_value_t *arg)
+{
+ int i;
+ int value = arg->v_int;
+ const char *p = get_pnc_string(value);
+
+ return arg_append(app, occ, p, strlen(p));
+}
+
arg_env_t *firm_get_arg_env(void)
{
#define X(name, letter) {"firm:" name, letter}
arg_env_t *firm_get_arg_env(void)
{
#define X(name, letter) {"firm:" name, letter}
static arg_handler_t firm_handler = { firm_get_arg_type, firm_emit };
static arg_handler_t ident_handler = { firm_get_arg_type, firm_emit_ident };
static arg_handler_t indent_handler = { firm_get_arg_type_int, firm_emit_indent };
static arg_handler_t firm_handler = { firm_get_arg_type, firm_emit };
static arg_handler_t ident_handler = { firm_get_arg_type, firm_emit_ident };
static arg_handler_t indent_handler = { firm_get_arg_type_int, firm_emit_indent };
+ static arg_handler_t pnc_handler = { firm_get_arg_type_int, firm_emit_pnc };
static arg_handler_t bitset_handler = { bitset_get_arg_type, bitset_emit };
static struct {
static arg_handler_t bitset_handler = { bitset_get_arg_type, bitset_emit };
static struct {
X("irn_nr", 'N'),
X("mode", 'm'),
X("block", 'B'),
X("irn_nr", 'N'),
X("mode", 'm'),
X("block", 'B'),
case 'n':
{
ir_node *irn = va_arg(args, ir_node *);
case 'n':
{
ir_node *irn = va_arg(args, ir_node *);
- if(irn)
- snprintf(buf, sizeof(buf), "%s%s:%ld",
+ if (irn)
+ if (is_Const(irn)) {
+ char tbuf[128];
+ tarval_snprintf(tbuf, sizeof(tbuf), get_Const_tarval(irn));
+ snprintf(buf, sizeof(buf), "%s%s<%s>:%ld",
+ get_irn_opname(irn), get_mode_name(get_irn_mode(irn)), tbuf, get_irn_node_nr(irn));
+ }
+ else
+ snprintf(buf, sizeof(buf), "%s%s:%ld",
get_irn_opname(irn), get_mode_name(get_irn_mode(irn)), get_irn_node_nr(irn));
else
strncpy(buf, STRNIL, sizeof(buf));
get_irn_opname(irn), get_mode_name(get_irn_mode(irn)), get_irn_node_nr(irn));
else
strncpy(buf, STRNIL, sizeof(buf));
/* clean the buffer again */
buf[0] = '\0';
break;
/* clean the buffer again */
buf[0] = '\0';
break;
+
+ case '=':
+ str = get_pnc_string(va_arg(args, int));
+ break;
}
dump_with_settings(app, object, limit, &settings, str);
}
dump_with_settings(app, object, limit, &settings, str);
- * Convencience for stdout dumping.
+ * Convenience for stdout dumping.
*/
void ir_printf(const char *fmt, ...)
{
*/
void ir_printf(const char *fmt, ...)
{
- * Convencience for file dumping.
+ * Convenience for file dumping.
*/
void ir_fprintf(FILE *f, const char *fmt, ...)
{
*/
void ir_fprintf(FILE *f, const char *fmt, ...)
{
- * Convencience for string dumping.
+ * Convenience for string dumping.
*/
void ir_snprintf(char *buf, size_t len, const char *fmt, ...)
{
*/
void ir_snprintf(char *buf, size_t len, const char *fmt, ...)
{
- * Convencience for string dumping.
+ * Convenience for string dumping.
*/
void ir_obst_printf(struct obstack *obst, const char *fmt, ...)
{
*/
void ir_obst_printf(struct obstack *obst, const char *fmt, ...)
{
ir_common_vprintf(&obst_appender, obst, 0, fmt, args);
}
ir_common_vprintf(&obst_appender, obst, 0, fmt, args);
}
+#else /* WITH_LIBCORE */