- FILE *F = env;
- int i = 0; /* to shutup gcc */
-
- /* dump this type or entity */
-
- switch (get_kind(tore)) {
- case k_entity:
- {
- ir_entity *ent = (ir_entity *)tore;
- ir_node *value;
- /* The node */
- dump_entity_node(F, ent, 0);
- /* The Edges */
- /* skip this to reduce graph. Member edge of type is parallel to this edge. *
- fprintf (F, "edge: { sourcename: \"%p\" targetname: \"%p\" "
- ENT_OWN_EDGE_ATTR "}\n", ent, get_entity_owner(ent));*/
- print_ent_type_edge(F,ent, get_entity_type(ent), ENT_TYPE_EDGE_ATTR);
- if (is_Class_type(get_entity_owner(ent))) {
- for(i = 0; i < get_entity_n_overwrites(ent); i++)
- print_ent_ent_edge(F,ent, get_entity_overwrites(ent, i), 0, ENT_OVERWRITES_EDGE_ATTR);
- }
- /* attached subgraphs */
- if (const_entities && (get_entity_variability(ent) != variability_uninitialized)) {
- if (is_atomic_entity(ent)) {
- value = get_atomic_ent_value(ent);
- if (value) {
- print_ent_node_edge(F, ent, value, ENT_VALUE_EDGE_ATTR, i);
- /* DDMN(value); $$$ */
- dump_const_expression(F, value);
- }
- }
- if (is_compound_entity(ent)) {
- for (i = 0; i < get_compound_ent_n_values(ent); i++) {
- value = get_compound_ent_value(ent, i);
- if (value) {
- print_ent_node_edge(F, ent, value, ENT_VALUE_EDGE_ATTR, i);
- dump_const_expression(F, value);
- print_ent_ent_edge(F, ent, get_compound_ent_value_member(ent, i), 0, ENT_CORR_EDGE_ATTR, i);
- /*
- fprintf (F, "edge: { sourcename: \"%p\" targetname: \"%p\" "
- ENT_CORR_EDGE_ATTR "}\n", GET_ENTID(ent),
- get_compound_ent_value_member(ent, i), i);
- */
- }
- }
- }
- }
- } break;
- case k_type:
- {
- ir_type *tp = (ir_type *)tore;
- dump_type_node(F, tp);
- /* and now the edges */
- switch (get_type_tpop_code(tp)) {
- case tpo_class:
- {
- for (i=0; i < get_class_n_supertypes(tp); i++)
- print_type_type_edge(F, tp,get_class_supertype(tp, i),TYPE_SUPER_EDGE_ATTR);
- for (i=0; i < get_class_n_members(tp); i++)
- print_type_ent_edge(F,tp,get_class_member(tp, i),TYPE_MEMBER_EDGE_ATTR);
- } break;
- case tpo_struct:
- {
- for (i=0; i < get_struct_n_members(tp); i++)
- print_type_ent_edge(F,tp,get_struct_member(tp, i),TYPE_MEMBER_EDGE_ATTR);
- } break;
- case tpo_method:
- {
- for (i = 0; i < get_method_n_params(tp); i++)
- print_type_type_edge(F,tp,get_method_param_type(tp, i),METH_PAR_EDGE_ATTR,i);
- for (i = 0; i < get_method_n_ress(tp); i++)
- print_type_type_edge(F,tp,get_method_res_type(tp, i),METH_RES_EDGE_ATTR,i);
- } break;
- case tpo_union:
- {
- for (i = 0; i < get_union_n_members(tp); i++)
- print_type_ent_edge(F,tp,get_union_member(tp, i),UNION_EDGE_ATTR);
- } break;
- case tpo_array:
- {
- print_type_type_edge(F,tp,get_array_element_type(tp),ARR_ELT_TYPE_EDGE_ATTR);
- print_type_ent_edge(F,tp,get_array_element_entity(tp),ARR_ENT_EDGE_ATTR);
- for (i = 0; i < get_array_n_dimensions(tp); i++) {
- ir_node *upper = get_array_upper_bound(tp, i);
- ir_node *lower = get_array_lower_bound(tp, i);
- print_node_type_edge(F, upper, tp, "label: \"upper %d\"", get_array_order(tp, i));
- print_node_type_edge(F, lower, tp, "label: \"lower %d\"", get_array_order(tp, i));
- dump_const_expression(F, upper);
- dump_const_expression(F, lower);
- }
-
- } break;
- case tpo_enumeration:
- {
- for (i = 0; i < get_enumeration_n_enums(tp); ++i) {
- dump_enum_item(F, tp, i);
- print_enum_item_edge(F, tp, i, "label: \"item %d\"", i);
- }
- } break;
- case tpo_pointer:
- {
- print_type_type_edge(F,tp,get_pointer_points_to_type(tp), PTR_PTS_TO_EDGE_ATTR);
- } break;
- case tpo_primitive:
- {
- } break;
- default: break;
- } /* switch type */
- }
- break; /* case k_type */
- default:
- {
- printf(" *** irdump, dump_type_info(l.%i), faulty type.\n", __LINE__);
- } break;
- } /* switch kind_or_entity */
+ FILE *F = env;
+ int i = 0; /* to shutup gcc */
+
+ /* dump this type or entity */
+
+ switch (get_kind(tore)) {
+ case k_entity: {
+ ir_entity *ent = (ir_entity *)tore;
+ ir_node *value;
+ /* The node */
+ dump_entity_node(F, ent, 0);
+ /* The Edges */
+ /* skip this to reduce graph. Member edge of type is parallel to this edge. *
+ fprintf(F, "edge: { sourcename: \"%p\" targetname: \"%p\" "
+ ENT_OWN_EDGE_ATTR "}\n", ent, get_entity_owner(ent));*/
+ print_ent_type_edge(F,ent, get_entity_type(ent), ENT_TYPE_EDGE_ATTR);
+ if (is_Class_type(get_entity_owner(ent))) {
+ for(i = 0; i < get_entity_n_overwrites(ent); i++)
+ print_ent_ent_edge(F,ent, get_entity_overwrites(ent, i), 0, ENT_OVERWRITES_EDGE_ATTR);
+ }
+ /* attached subgraphs */
+ if (const_entities && (get_entity_variability(ent) != variability_uninitialized)) {
+ if (is_atomic_entity(ent)) {
+ value = get_atomic_ent_value(ent);
+ if (value) {
+ print_ent_node_edge(F, ent, value, ENT_VALUE_EDGE_ATTR, i);
+ /* DDMN(value); $$$ */
+ dump_const_expression(F, value);
+ }
+ }
+ if (is_compound_entity(ent)) {
+ for (i = 0; i < get_compound_ent_n_values(ent); i++) {
+ value = get_compound_ent_value(ent, i);
+ if (value) {
+ print_ent_node_edge(F, ent, value, ENT_VALUE_EDGE_ATTR, i);
+ dump_const_expression(F, value);
+ print_ent_ent_edge(F, ent, get_compound_ent_value_member(ent, i), 0, ENT_CORR_EDGE_ATTR, i);
+ /*
+ fprintf(F, "edge: { sourcename: \"%p\" targetname: \"%p\" "
+ ENT_CORR_EDGE_ATTR "}\n", GET_ENTID(ent),
+ get_compound_ent_value_member(ent, i), i);
+ */
+ }
+ }
+ }
+ }
+ break;
+ }
+ case k_type: {
+ ir_type *tp = (ir_type *)tore;
+ dump_type_node(F, tp);
+ /* and now the edges */
+ switch (get_type_tpop_code(tp)) {
+ case tpo_class:
+ for (i=0; i < get_class_n_supertypes(tp); i++)
+ print_type_type_edge(F, tp,get_class_supertype(tp, i),TYPE_SUPER_EDGE_ATTR);
+ for (i=0; i < get_class_n_members(tp); i++)
+ print_type_ent_edge(F,tp,get_class_member(tp, i),TYPE_MEMBER_EDGE_ATTR);
+ break;
+ case tpo_struct:
+ for (i=0; i < get_struct_n_members(tp); i++)
+ print_type_ent_edge(F,tp,get_struct_member(tp, i),TYPE_MEMBER_EDGE_ATTR);
+ break;
+ case tpo_method:
+ for (i = 0; i < get_method_n_params(tp); i++)
+ print_type_type_edge(F,tp,get_method_param_type(tp, i),METH_PAR_EDGE_ATTR,i);
+ for (i = 0; i < get_method_n_ress(tp); i++)
+ print_type_type_edge(F,tp,get_method_res_type(tp, i),METH_RES_EDGE_ATTR,i);
+ break;
+ case tpo_union:
+ for (i = 0; i < get_union_n_members(tp); i++)
+ print_type_ent_edge(F,tp,get_union_member(tp, i),UNION_EDGE_ATTR);
+ break;
+ case tpo_array:
+ print_type_type_edge(F,tp,get_array_element_type(tp),ARR_ELT_TYPE_EDGE_ATTR);
+ print_type_ent_edge(F,tp,get_array_element_entity(tp),ARR_ENT_EDGE_ATTR);
+ for (i = 0; i < get_array_n_dimensions(tp); i++) {
+ ir_node *upper = get_array_upper_bound(tp, i);
+ ir_node *lower = get_array_lower_bound(tp, i);
+ print_node_type_edge(F, upper, tp, "label: \"upper %d\"", get_array_order(tp, i));
+ print_node_type_edge(F, lower, tp, "label: \"lower %d\"", get_array_order(tp, i));
+ dump_const_expression(F, upper);
+ dump_const_expression(F, lower);
+ }
+ break;
+ case tpo_enumeration:
+ for (i = 0; i < get_enumeration_n_enums(tp); ++i) {
+ dump_enum_item(F, tp, i);
+ print_enum_item_edge(F, tp, i, "label: \"item %d\"", i);
+ }
+ break;
+ case tpo_pointer:
+ print_type_type_edge(F,tp,get_pointer_points_to_type(tp), PTR_PTS_TO_EDGE_ATTR);
+ break;
+ case tpo_primitive:
+ break;
+ default:
+ break;
+ } /* switch type */
+ break; /* case k_type */
+ }
+ default:
+ printf(" *** irdump, dump_type_info(l.%i), faulty type.\n", __LINE__);
+ } /* switch kind_or_entity */