-#define A(s) occ->hash ? s " ": ""
-
- void *X = arg->v_ptr;
- firm_kind *obj = X;
-
- int i, n;
- ir_node *block;
- char buf[256];
- char tv[256];
-
- buf[0] = '\0';
-
- if (! X)
- strncpy(buf, "(null)", sizeof(buf));
- else {
- switch (*obj) {
- case k_BAD:
- snprintf(buf, sizeof(buf), "BAD[%p]", X);
- break;
- case k_entity:
- snprintf(buf, sizeof(buf), "%s%s[%ld]", A("ent"),
- isupper(occ->conversion) ? get_entity_ld_name(X): get_entity_name(X),
- get_entity_nr(X));
- break;
- case k_type:
- snprintf(buf, sizeof(buf), "%s%s:%s[%ld]", A("type"), get_type_tpop_name(X), get_type_name(X), get_type_nr(X));
- break;
- case k_ir_graph:
- snprintf(buf, sizeof(buf), "%s%s[%ld]", A("irg"), get_entity_name(get_irg_entity(X)), get_irg_graph_nr(X));
- break;
- case k_ir_node:
- switch (occ->conversion) {
- case 'B':
- block = is_no_Block(X) ? get_nodes_block(X) : X;
- snprintf(buf, sizeof(buf), "%s%s%s[%ld]", A("irn"), get_irn_opname(block),
- get_mode_name(get_irn_mode(block)), get_irn_node_nr(block));
- break;
- case 'N':
- snprintf(buf, sizeof(buf), "%ld", get_irn_node_nr(X));
- break;
- default:
- snprintf(buf, sizeof(buf), "%s%s%s[%ld]", A("irn"), get_irn_opname(X),
- get_mode_name(get_irn_mode(X)), get_irn_node_nr(X));
- }
- break;
- case k_ir_mode:
- snprintf(buf, sizeof(buf), "%s%s", A("mode"), get_mode_name(X));
- break;
- case k_tarval:
- tarval_snprintf(tv, sizeof(tv), X);
- snprintf(buf, sizeof(buf), "%s%s", A("tv"), tv);
- break;
- case k_ir_loop:
- snprintf(buf, sizeof(buf), "ldepth[%d]", get_loop_depth(X));
- break;
- case k_ir_op:
- snprintf(buf, sizeof(buf), "%s%s", A("op"), get_op_name(X));
- break;
- case k_ir_compound_graph_path:
- strncat(buf, A("cgp"), sizeof(buf));
-
- n = get_compound_graph_path_length(X);
- for (i = 0; i < n; ++i) {
- entity *ent = get_compound_graph_path_node(X, i);
- strncat(buf, get_entity_name(ent), sizeof(buf));
- if (i < n - 1)
- strncat(buf, ".", sizeof(buf));
- }
- break;
- default:
- snprintf(buf, sizeof(buf), "UNKWN[%p]", X);
- }
- }
- return arg_append(app, occ, buf, strlen(buf));
+#define A(s) occ->flag_hash ? s " ": ""
+
+ void *X = arg->v_ptr;
+ firm_kind *obj = X;
+ int i, n;
+ ir_node *block;
+ char add[64];
+ char buf[256];
+ char tv_buf[256];
+ ir_entity *ent;
+
+ buf[0] = '\0';
+ add[0] = '\0';
+
+ if (! X)
+ strncpy(buf, "(null)", sizeof(buf));
+ else {
+ switch (*obj) {
+ case k_BAD:
+ snprintf(buf, sizeof(buf), "BAD");
+ snprintf(add, sizeof(add), "[%p]", X);
+ break;
+ case k_entity:
+ snprintf(buf, sizeof(buf), "%s%s", A("ent"),
+ isupper(occ->conversion) ? get_entity_ld_name_ex(X): get_entity_name(X));
+ snprintf(add, sizeof(add), "[%ld]", get_entity_nr(X));
+ break;
+ case k_type:
+ snprintf(buf, sizeof(buf), "%s%s:%s", A("type"), get_type_tpop_name(X), get_type_name(X));
+ snprintf(add, sizeof(add), "[%ld]", get_type_nr(X));
+ break;
+ case k_ir_graph:
+ if (X == get_const_code_irg())
+ snprintf(buf, sizeof(buf), "%s<ConstCodeIrg>", A("irg"));
+ else
+ snprintf(buf, sizeof(buf), "%s%s", A("irg"), get_entity_name(get_irg_entity(X)));
+ snprintf(add, sizeof(add), "[%ld]", get_irg_graph_nr(X));
+ break;
+ case k_ir_node:
+ switch (occ->conversion) {
+ case 'B':
+ block = is_no_Block(X) ? get_nodes_block(X) : X;
+ snprintf(buf, sizeof(buf), "%s%s%s", A("irn"), get_irn_opname(block),
+ get_mode_name(get_irn_mode(block)));
+ snprintf(add, sizeof(add), "[%ld]", get_irn_node_nr(block));
+ break;
+ case 'N':
+ snprintf(buf, sizeof(buf), "%ld", get_irn_node_nr(X));
+ break;
+ default:
+ if (is_Const(X)) {
+ tarval *tv = get_Const_tarval(X);
+ if (tv)
+ tarval_snprintf(tv_buf, sizeof(tv_buf), tv);
+ else
+ strncpy(tv_buf, "(NULL)", sizeof(tv_buf));
+ snprintf(buf, sizeof(buf), "%s%s%s<%s>", A("irn"), get_irn_opname(X),
+ get_mode_name(get_irn_mode(X)), tv_buf);
+ }
+ 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:%d]", get_irn_node_nr(X), get_irn_idx(X));
+ }
+ break;
+ case k_ir_mode:
+ snprintf(buf, sizeof(buf), "%s%s", A("mode"), get_mode_name(X));
+ break;
+ case k_tarval:
+ tarval_snprintf(tv_buf, sizeof(tv_buf), X);
+ snprintf(buf, sizeof(buf), "%s%s", A("tv"), tv_buf);
+ break;
+ case k_ir_loop:
+ snprintf(buf, sizeof(buf), "loop[%d:%d]", get_loop_loop_nr(X), get_loop_depth(X));
+ break;
+ case k_ir_op:
+ snprintf(buf, sizeof(buf), "%s%s", A("op"), get_op_name(X));
+ break;
+ case k_ir_compound_graph_path:
+ n = get_compound_graph_path_length(X);
+
+ for (i = 0; i < n; ++i) {
+ ent = get_compound_graph_path_node(X, i);
+
+ strncat(buf, ".", sizeof(buf));
+ strncat(buf, get_entity_name(ent), sizeof(buf));
+ if (is_Array_type(get_entity_owner(ent))) {
+ snprintf(add, sizeof(add), "[%d]",
+ get_compound_graph_path_array_index(X, i));
+ strncat(buf, add, sizeof(buf));
+ }
+ }
+ add[0] = '\0';
+ break;
+ case k_ir_extblk:
+ snprintf(buf, sizeof(buf), "ExtBlock");
+ snprintf(add, sizeof(add), "[%ld]", get_irn_node_nr(get_extbb_leader(X)));
+ break;
+
+ default:
+ snprintf(buf, sizeof(buf), "UNKWN");
+ snprintf(add, sizeof(add), "[%p]", X);
+ }
+ }
+
+ if (occ->flag_plus)
+ strncat(buf, add, sizeof(buf));
+
+ return lc_arg_append(app, occ, buf, strlen(buf));