X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firdump.c;h=519b5ca4c59d2875e7fbedec83b935d3768e66de;hb=aeccc4a872226c8e08e6241bcd56b846e400c52d;hp=8dac88e7b00c099a6b23bf8ceda658ce3a5023c6;hpb=3d7c0f81114250f94cf83365b54916dd422c6c9e;p=libfirm diff --git a/ir/ir/irdump.c b/ir/ir/irdump.c index 8dac88e7b..519b5ca4c 100644 --- a/ir/ir/irdump.c +++ b/ir/ir/irdump.c @@ -50,6 +50,7 @@ #define PTR_PTS_TO_EDGE_ATTR "class: 9 label: \"points to\" color:green" #define ARR_ELT_TYPE_EDGE_ATTR "class: 10 label: \"arr elt\" color:green" #define ENT_OVERWRITES_EDGE_ATTR "class: 11 label: \"overwrites\" color:red" +#define TYPE_MEMBER_EDGE_ATTR "class: 12 label: \"member\" color:blue" #define PRINT_NODEID(X) fprintf(F, "%p", X) @@ -78,8 +79,8 @@ dump_node_opcode (ir_node *n) xfprintf (F, "%I", get_SymConst_ptrinfo(n)); } else { assert(get_kind(get_SymConst_type(n)) == k_type); - assert(get_type_nameid(get_SymConst_type(n))); - xfprintf (F, "%s ", id_to_str(get_type_nameid(get_SymConst_type(n)))); + assert(get_type_ident(get_SymConst_type(n))); + xfprintf (F, "%s ", id_to_str(get_type_ident(get_SymConst_type(n)))); if (get_SymConst_kind == type_tag) xfprintf (F, "tag"); else @@ -322,7 +323,7 @@ dump_ir_node (ir_node *n) break; case iro_SymConst: assert(get_kind(get_SymConst_type(n)) == k_type); - assert(get_type_nameid(get_SymConst_type(n))); + assert(get_type_ident(get_SymConst_type(n))); xfprintf (F, "\"%s ", get_type_name(get_SymConst_type(n))); switch (n->attr.i.num){ case type_tag: @@ -494,7 +495,11 @@ dump_type_info (type_or_ent *tore, void *env) { case k_entity: { entity *ent = (entity *)tore; - xfprintf (F, "\"ent %I\" " ENTITY_NODE_ATTR "}\n", get_entity_ident(ent)); + xfprintf (F, "\"ent %I\" " ENTITY_NODE_ATTR , get_entity_ident(ent)); + if(dynamic_allocated == get_entity_allocation(ent)) + xfprintf (F, " info1:\"dynamic allocated\"}\n"); + else + xfprintf (F, " info1:\"static allocated\"}\n"); xfprintf (F, "edge: { sourcename: \"%p\" targetname: \"%p\" " ENT_OWN_EDGE_ATTR "}\n", tore, get_entity_owner(ent)); xfprintf (F, "edge: { sourcename: \"%p\" targetname: \"%p\" " @@ -507,7 +512,7 @@ dump_type_info (type_or_ent *tore, void *env) { { /* why can't I cast here??? @@@ */ type *type = tore; - xfprintf (F, "\"%I %I", get_type_tpop_nameid(type), get_type_nameid(type)); + xfprintf (F, "\"%I %I", get_type_tpop_nameid(type), get_type_ident(type)); switch (get_type_tpop_code(type)) { case tpo_class: @@ -517,10 +522,18 @@ dump_type_info (type_or_ent *tore, void *env) { xfprintf (F, "edge: { sourcename: \"%p\" targetname: \"%p\" " TYPE_SUPER_EDGE_ATTR "}\n", type, get_class_supertype(type, i)); + for (i=0; i < get_class_n_member(type); i++) + xfprintf (F, "edge: { sourcename: \"%p\" targetname: \"%p\" " + TYPE_MEMBER_EDGE_ATTR "}\n", + type, get_class_member(type, i)); } break; case tpo_struct: { xfprintf (F, "\"}\n"); + for (i=0; i < get_struct_n_member(type); i++) + xfprintf (F, "edge: { sourcename: \"%p\" targetname: \"%p\" " + TYPE_MEMBER_EDGE_ATTR "}\n", + type, get_struct_member(type, i)); } break; case tpo_method: { @@ -565,8 +578,8 @@ dump_type_info (type_or_ent *tore, void *env) { } break; default: break; } /* switch type */ - - } break; /* case k_type */ + } + break; /* case k_type */ default: { xfprintf (F, "\" faulty type \"}\n"); @@ -633,6 +646,8 @@ void vcg_open (ir_graph *irg, char *suffix) { "classname 8: \"Union\"" "classname 9: \"Points-to\"" "classname 10: \"Array Element Type\"" + "classname 11: \"Overwrites\"" + "classname 12: \"Member\"" , cp, label); xfprintf (F, "\n"); /* a separator */ @@ -669,14 +684,16 @@ void vcg_open_name (const char *name) { "orientation: bottom_to_top\n" "classname 1: \"Data\"\n" "classname 2: \"Block\"\n" - "classname 3: \"Entity type\"" - "classname 4: \"Entity owner\"" - "classname 5: \"Method Param\"" - "classname 6: \"Method Res\"" - "classname 7: \"Super\"" - "classname 8: \"Union\"" - "classname 9: \"Points-to\"" - "classname 10: \"Array Element Type\"" + "classname 3: \"Entity type\"\n" + "classname 4: \"Entity owner\"\n" + "classname 5: \"Method Param\"\n" + "classname 6: \"Method Res\"\n" + "classname 7: \"Super\"\n" + "classname 8: \"Union\"\n" + "classname 9: \"Points-to\"\n" + "classname 10: \"Array Element Type\"\n" + "classname 11: \"Overwrites\"\n" + "classname 12: \"Member\"\n" , name, label); xfprintf (F, "\n"); /* a separator */