# include "config.h"
#endif
+#ifdef WITH_LIBCORE
+
#include "bitset.h"
#include <ctype.h>
const char *prefix = "";
lc_arg_append(app, occ, "[", 1);
- for(p = bitset_next_set(b, 0); p != -1; p = bitset_next_set(b, p)) {
+ bitset_foreach(b, p) {
int n;
n = snprintf(buf, sizeof(buf), "%s%d", prefix, (int) p);
return lc_arg_append(app, occ, buf, strlen(buf));
}
+/**
+ * Beware: do not set the entity ld_name
+ */
+static const char *get_entity_ld_name_ex(entity *ent) {
+ if (ent->ld_name)
+ return get_entity_ld_name(ent);
+ return get_entity_name(ent);
+}
+
/**
* emit a Firm object
*/
char add[64];
char buf[256];
char tv[256];
+ entity *ent;
buf[0] = '\0';
add[0] = '\0';
break;
case k_entity:
snprintf(buf, sizeof(buf), "%s%s", A("ent"),
- isupper(occ->conversion) ? get_entity_ld_name(X): get_entity_name(X));
+ 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", 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);
+ ent = get_compound_graph_path_node(X, i);
+
+ strncat(buf, ".", sizeof(buf));
strncat(buf, get_entity_name(ent), sizeof(buf));
- if (i < n - 1)
- strncat(buf, ".", 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)
+ if (occ->flag_plus)
strncat(buf, add, sizeof(buf));
return lc_arg_append(app, occ, buf, strlen(buf));
X("mode", 'm'),
X("block", 'B'),
X("pnc", '='),
+ X("cg_path", 'P'),
};
int i;
lc_arg_register(env, "firm:indent", 'D', &indent_handler);
lc_arg_register(env, "firm:pnc", '=', &pnc_handler);
lc_arg_register(env, "firm:dbg_info", 'G', &debug_handler);
- /* lc_arg_register(env, "firm:bitset", 'b', &bitset_handler); */
+ lc_arg_register(env, "firm:bitset", 'B', &bitset_handler);
}
return env;
}
+
+#endif /* WITH_LIBCORE */