Commit fa6780d8 authored by Jonas Fietz's avatar Jonas Fietz
Browse files

Add dumper code for VRP information

This commit adds the code and prototypes for dumping vrp information

[r27095]
parent 671350c7
......@@ -1201,6 +1201,29 @@ int dump_node_label(FILE *F, ir_node *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.
......
......@@ -108,6 +108,7 @@ dump_node_opcode(FILE *F, ir_node *n);
int dump_node_label(FILE *F, ir_node *n);
int dump_vrp_info(FILE *F, ir_node *n);
/** Writes vcg representation with title "PRINT_TYPEID(tp)" to file F. */
int dump_type_node(FILE *F, ir_type *tp);
......
......@@ -397,6 +397,10 @@ int dump_irnode_to_file(FILE *F, ir_node *n) {
default: ;
}
if (n->vrp.valid) {
dump_vrp_info(F, n);
}
if (get_irg_typeinfo_state(get_irn_irg(n)) == ir_typeinfo_consistent ||
get_irg_typeinfo_state(get_irn_irg(n)) == ir_typeinfo_inconsistent )
if (get_irn_typeinfo_type(n) != firm_none_type)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment