int dump_dominator_information_flag = 0;
int dump_loop_information_flag = 0;
int dump_const_local = 0;
+bool opt_dump_analysed_type_info = 1;
INLINE bool get_opt_dump_const_local(void) {
if (!dump_out_edge_flag && !dump_loop_information_flag)
} else {
assert(get_kind(get_SymConst_type(n)) == k_type);
assert(get_type_ident(get_SymConst_type(n)));
- fprintf (F, "SymC %s ", get_id_str(get_type_ident(get_SymConst_type(n))));
+ fprintf (F, "SymC %s ", get_type_name(get_SymConst_type(n)));
if (get_SymConst_kind(n) == type_tag)
fprintf (F, "tag");
else
case iro_Shr:
case iro_Abs:
case iro_Cmp:
- fprintf (F, "%s", get_id_str(get_mode_ident(get_irn_mode(n))));
+ fprintf (F, "%s", get_mode_name(get_irn_mode(n)));
break;
default:
;
}
}
+static void dump_node_typeinfo(ir_node *n) {
+ if (!opt_dump_analysed_type_info) return;
+ if (get_irg_typeinfo_state(current_ir_graph) == irg_typeinfo_consistent ||
+ get_irg_typeinfo_state(current_ir_graph) == irg_typeinfo_inconsistent ) {
+ type *tp = get_irn_type(n);
+ if (tp != none_type)
+ fprintf (F, " [%s]", get_type_name(tp));
+ else
+ fprintf (F, " []");
+ }
+}
+
static INLINE void
dump_node_nodeattr (ir_node *n)
{
switch (get_irn_opcode(n)) {
case iro_Start:
if (false && interprocedural_view) {
- fprintf (F, "%s", get_id_str(get_entity_ident(get_irg_ent(current_ir_graph))));
+ fprintf (F, "%s", get_entity_name(get_irg_ent(current_ir_graph)));
}
break;
case iro_Proj:
fprintf (F, "%s", get_entity_name(get_Sel_entity(n)));
} break;
case iro_Cast: {
- fprintf (F, "to %s", get_type_name(get_Cast_type(n)));
+ fprintf (F, "(%s)", get_type_name(get_Cast_type(n)));
} break;
default:
;
for (i = 0; i < get_method_n_ress(tp); ++i)
fprintf(F, " resul %d type: %s \n", i, get_type_name(get_method_res_type(tp, i)));
} break;
+ case iro_Return: {
+ if (!interprocedural_view) {
+ type *tp = get_entity_type(get_irg_ent(current_ir_graph));
+ fprintf(F, "return in method of type %s \n", get_type_name(tp));
+ for (i = 0; i < get_method_n_ress(tp); ++i)
+ fprintf(F, " res %d type: %s \n", i, get_type_name(get_method_res_type(tp, i)));
+ }
+ } break;
+ case iro_Const: {
+ type *tp = get_Const_type(n);
+ assert(tp != none_type);
+ fprintf(F, "Const of type %s \n", get_type_name(get_Const_type(n)));
+ } break;
default: ;
}
+ if (get_irg_typeinfo_state(current_ir_graph) == irg_typeinfo_consistent ||
+ get_irg_typeinfo_state(current_ir_graph) == irg_typeinfo_inconsistent )
+ if (get_irn_type(n) != none_type)
+ fprintf (F, "\nAnalysed type: %s", get_type_name(get_irn_type(n)));
fprintf (F, "\"");
fprintf(F, " label: \"");
dump_node_opcode(con);
dump_node_mode (con);
+ dump_node_typeinfo(con);
fprintf (F, " ");
dump_node_nodeattr(con);
#ifdef DEBUG_libfirm
dump_node_opcode(n);
dump_node_mode (n);
+ dump_node_typeinfo(n);
fprintf (F, " ");
dump_node_nodeattr(n);
#ifdef DEBUG_libfirm
fprintf(F, "state: layout_fixed,\n");
}
if (get_type_mode(tp))
- fprintf(F, "mode: %s,\n", get_id_str(get_mode_ident(get_type_mode(tp))));
+ fprintf(F, "mode: %s,\n", get_mode_name(get_type_mode(tp)));
fprintf(F, "size: %dB,\n", get_type_size(tp));
}
{
fprintf (F, "node: {title: ");
PRINT_TYPEID(tp);
- fprintf (F, " label: \"%s %s\"", get_id_str(get_type_tpop_nameid(tp)), get_id_str(get_type_ident(tp)));
+ fprintf (F, " label: \"%s %s\"", get_type_tpop_name(tp), get_type_name(tp));
fprintf (F, " info1: \"");
print_type_info(tp);
fprintf (F, "\"");
PRINT_ENTID(ent); fprintf(F, "\"");
fprintf (F, DEFAULT_TYPE_ATTRIBUTE);
fprintf (F, "label: ");
- fprintf (F, "\"ent %s\" " ENTITY_NODE_ATTR , get_id_str(get_entity_ident(ent)));
+ fprintf (F, "\"ent %s\" " ENTITY_NODE_ATTR , get_entity_name(ent));
fprintf (F, "\n info1: \"\nid: "); PRINT_ENTID(ent);
fprintf (F, "\nallocation: ");
X(peculiarity_existent);
}
fprintf(F, "\nname: %s\nld_name: %s",
- get_id_str(get_entity_ident(ent)),
- get_id_str(get_entity_ld_ident(ent)));
+ get_entity_name(ent), get_entity_ld_name(ent));
fprintf(F, "\noffset: %d", get_entity_offset(ent));
if (is_method_type(get_entity_type(ent))) {
if (get_entity_irg(ent)) /* can be null */
int i;
fprintf(F, "graph: { title: %p label: %s status:clustered color:white \n",
- (void*) irg, get_id_str(get_entity_ident(get_irg_ent(irg))));
+ (void*) irg, get_entity_name(get_irg_ent(irg)));
for (i = ARR_LEN(arr) - 1; i >= 0; --i) {
ir_node * node = arr[i];
vcg_close();
}
+
+/* Dump the information of type field specified in ana/irtypeinfo.h.
+ * If the flag is set, the type name is output in [] in the node label,
+ * else it is output as info.
+ */
+void dump_analysed_type_info(bool b) {
+ opt_dump_analysed_type_info = b;
+}