return ERROR_TXT;
}
-/**
- * returns the name of a type or <ERROR> if mode is NOT a mode object.
- * in the later case, sets bad
- */
-const char *get_type_name_ex(const ir_type *tp, int *bad) {
- if (is_type(tp))
- return get_type_name(tp);
- *bad |= 1;
- return ERROR_TXT;
-}
-
#define CUSTOM_COLOR_BASE 100
static const char *color_names[ird_color_count];
static const char *color_rgb[ird_color_count];
fprintf(F, "SymC %s offset", get_entity_name(get_SymConst_entity(n)));
break;
case symconst_type_tag:
- fprintf(F, "SymC %s tag", get_type_name_ex(get_SymConst_type(n), &bad));
+ ir_fprintf(F, "SymC %+F tag", get_SymConst_type(n));
break;
case symconst_type_size:
- fprintf(F, "SymC %s size", get_type_name_ex(get_SymConst_type(n), &bad));
+ ir_fprintf(F, "SymC %+F size", get_SymConst_type(n));
break;
case symconst_type_align:
- fprintf(F, "SymC %s align", get_type_name_ex(get_SymConst_type(n), &bad));
+ ir_fprintf(F, "SymC %+F align", get_SymConst_type(n));
break;
case symconst_enum_const:
- fprintf(F, "SymC %s enum", get_enumeration_name(get_SymConst_enum(n)));
+ fprintf(F, "SymC %s enum", get_enumeration_const_name(get_SymConst_enum(n)));
break;
}
break;
if (get_irg_typeinfo_state(current_ir_graph) == ir_typeinfo_consistent ||
get_irg_typeinfo_state(current_ir_graph) == ir_typeinfo_inconsistent) {
ir_type *tp = get_irn_typeinfo_type(n);
- if (tp != firm_none_type)
- fprintf(F, "[%s] ", get_type_name_ex(tp, &bad));
- else
+ if (tp != firm_none_type) {
+ ir_fprintf(F, "[%+F]", tp);
+ } else {
fprintf(F, "[] ");
+ }
}
}
return bad;
/** the lookup table for Proj(Call) names */
static const pns_lookup_t call_lut[] = {
#define X(a) { pn_Call_##a, #a }
- X(M_regular),
+ X(M),
X(X_regular),
X(X_except),
X(T_result),
- X(M_except),
X(P_value_res_base)
#undef X
};
X(M),
X(X_regular),
X(X_except),
- X(M_except)
#undef X
};
X(X_regular),
X(X_except),
X(res),
- X(M_except),
#undef X
};
fprintf(F, "%s ", get_ent_dump_name(get_Sel_entity(n)));
break;
case iro_Cast:
- fprintf(F, "(%s) ", get_type_name_ex(get_Cast_type(n), &bad));
+ ir_fprintf(F, "(%+F)", get_Cast_type(n));
break;
case iro_Confirm:
fprintf(F, "%s ", get_pnc_string(get_Confirm_cmp(n)));
break;
case iro_CopyB:
- fprintf(F, "(%s) ", get_type_name_ex(get_CopyB_type(n), &bad));
+ ir_fprintf(F, "(%+F)", get_CopyB_type(n));
break;
default:
int bad = 0;
bad |= dump_node_opcode(F, n);
+ fputs(" ", F);
bad |= dump_node_mode(F, n);
fprintf(F, " ");
bad |= dump_node_typeinfo(F, n);
return bad;
}
+/* Dumps the vrp information of a node to a file */
+int dump_vrp_info(FILE *F, ir_node *n) {
+ if (!n->vrp.valid) {
+ return 1;
+ }
+
+ fprintf(F, "range_type: %d\n", n->vrp.range_type);
+ if (n->vrp.range_type == VRP_RANGE || n->vrp.range_type ==
+ VRP_ANTIRANGE) {
+ ir_fprintf(F, "range_bottom: %F\n",n->vrp.range_bottom);
+ ir_fprintf(F, "range_top: %F\n", n->vrp.range_top);
+ }
+ ir_fprintf(F, "bits_set: %T\n", n->vrp.bits_set);
+ ir_fprintf(F, "bits_not_set: %T\n", n->vrp.bits_not_set);
+ if (n->vrp.bits_node == NULL) {
+ fprintf(F, "bits_node: None");
+ } else {
+ fprintf(F, "bits_node: #%ld\n", get_irn_node_nr(n->vrp.bits_node));
+ }
+
+ return 0;
+}
+
/**
* Dumps the attributes of a node n into the file F.
* Currently this is only the color of a node.
{
char buf[1024];
- if (__dbg_info_snprint) {
- buf[0] = '\0';
- if (__dbg_info_snprint(buf, sizeof(buf), dbg) > 0)
- fprintf(F, " info3: \"%s\"\n", buf);
+ ir_dbg_info_snprint(buf, sizeof(buf), dbg);
+ if (buf[0] != 0) {
+ fprintf(F, " info3: \"%s\"\n", buf);
}
}
+static void print_type_dbg_info(FILE *F, type_dbg_info *dbg)
+{
+ (void) F;
+ (void) dbg;
+ /* TODO */
+}
+
/**
* Dump a node
*/
static void print_typespecific_vcgattr(FILE *F, ir_type *tp) {
switch (get_type_tpop_code(tp)) {
case tpo_class:
- if (peculiarity_existent == get_class_peculiarity(tp))
- fprintf(F, " " TYPE_CLASS_NODE_ATTR);
- else
- fprintf(F, " " TYPE_DESCRIPTION_NODE_ATTR);
+ fprintf(F, " " TYPE_CLASS_NODE_ATTR);
break;
case tpo_struct:
fprintf(F, " " TYPE_METH_NODE_ATTR);
} /* switch type */
}
-
int dump_type_node(FILE *F, ir_type *tp)
{
int bad = 0;
fprintf(F, "node: {title: ");
PRINT_TYPEID(tp);
- fprintf(F, " label: \"%s %s\"", get_type_tpop_name(tp), get_type_name_ex(tp, &bad));
- fprintf(F, " info1: \"");
-#if 0
- bad |= print_type_info(F, tp);
- print_typespecific_info(F, tp);
-#else
+ ir_fprintf(F, " label: \"%s %+F\" info1: \"", get_type_tpop_name(tp), tp);
dump_type_to_file(F, tp, dump_verbosity_max);
-#endif
fprintf(F, "\"\n");
- print_dbg_info(F, get_type_dbg_info(tp));
+ print_type_dbg_info(F, get_type_dbg_info(tp));
print_typespecific_vcgattr(F, tp);
fprintf(F, "}\n");
{
char buf[1024];
ir_enum_const *ec = get_enumeration_const(tp, pos);
- ident *id = get_enumeration_nameid(ec);
+ ident *id = get_enumeration_const_nameid(ec);
tarval *tv = get_enumeration_value(ec);
if (tv)
print_ent_ent_edge(F,ent, get_entity_overwrites(ent, i), 0, -1, 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)) {
- if (has_entity_initializer(ent)) {
- /* new style initializers */
- dump_entity_initializer(F, ent);
- } else {
- /* old style compound entity values */
- for (i = get_compound_ent_n_values(ent) - 1; i >= 0; --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, -1, 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);
- */
- }
+ if (const_entities) {
+ if (ent->initializer != NULL) {
+ /* new style initializers */
+ dump_entity_initializer(F, ent);
+ } else if (entity_has_compound_ent_values(ent)) {
+ /* old style compound entity values */
+ for (i = get_compound_ent_n_values(ent) - 1; i >= 0; --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, -1, 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);
+ */
}
}
}