dump_const_local = b;
}
-void turn_off_constant_entity_values(void) {
- const_entities = 0;
+void dump_constant_entity_values(bool b) {
+ const_entities = b;
}
void dump_keepalive_edges(bool b) {
return dump_keepalive;
}
-void dump_out_edges(void) {
- dump_out_edge_flag = 1;
+void dump_out_edges(bool b) {
+ dump_out_edge_flag = b;
}
-void dump_dominator_information(void) {
- dump_dominator_information_flag = 1;
+void dump_dominator_information(bool b) {
+ dump_dominator_information_flag = b;
}
-void dump_loop_information(void) {
- dump_loop_information_flag = 1;
-}
-
-void dont_dump_loop_information(void) {
- dump_loop_information_flag = 0;
+void dump_loop_information(bool b) {
+ dump_loop_information_flag = b;
}
void dump_backedge_information(bool b) {
* dumps the attributes of a node n into the file F.
* Currently this is only the color of a node.
*/
-static void dump_node_vcgattr(FILE *F, ir_node *n, int bad)
+static void dump_node_vcgattr(FILE *F, ir_node *node, ir_node *local, int bad)
{
+ ir_node *n;
+
if (bad) {
fprintf(F, "color: red");
return;
}
if (dump_node_vcgattr_hook)
- if (dump_node_vcgattr_hook(F, n))
+ if (dump_node_vcgattr_hook(F, node, local))
return;
+ n = local ? local : node;
+
switch (get_irn_opcode(n)) {
case iro_Start:
case iro_EndReg:
fprintf(F, " %ld", get_irn_node_nr(con));
fprintf(F, "\" ");
bad |= dump_node_info(F, con);
- dump_node_vcgattr(F, con, bad);
+ dump_node_vcgattr(F, n, con, bad);
fprintf(F, "}\n");
}
}
/** If the block of an edge is a const_like node, dump it local with an edge */
static void dump_const_block_local(FILE *F, ir_node *n) {
+ ir_node *blk;
+
if (!get_opt_dump_const_local()) return;
- ir_node *blk = get_nodes_block(n);
+ blk = get_nodes_block(n);
if (is_constlike_node(blk)) {
int bad = 0;
fprintf(F, " %ld", get_irn_node_nr(blk));
fprintf(F, "\" ");
bad |= dump_node_info(F, blk);
- dump_node_vcgattr(F, blk, bad);
+ dump_node_vcgattr(F, n, blk, bad);
fprintf(F, "}\n");
fprintf (F, "edge: { sourcename: \"");
fprintf(F, "\" ");
bad |= dump_node_info(F, n);
print_node_error(F, p);
- dump_node_vcgattr(F, n, bad);
+ dump_node_vcgattr(F, n, NULL, bad);
fprintf(F, "}\n");
dump_const_node_local(F, n);
#if DO_HEAPANALYSIS
/* dump edges to our inputs */
static void
dump_ir_data_edges(FILE *F, ir_node *n) {
- int i, visited = get_irn_visited(n);
+ int i;
+ unsigned long visited = get_irn_visited(n);
if ((get_irn_op(n) == op_End) && (!dump_keepalive))
return;
if (!max) {
color = 0;
} else {
+ int step;
+
/* if small, scale to the full color range. */
if (max < n_colors)
my = my * (n_colors/max);
- int step = 1 + (max / n_colors);
+ step = 1 + (max / n_colors);
color = my/step;
}
}
static int get_entity_color(entity *ent) {
- assert(get_entity_irg(ent));
ir_graph *irg = get_entity_irg(ent);
+ assert(irg);
- int rec_depth = get_irg_recursion_depth(irg);
- int loop_depth = get_irg_loop_depth(irg);
- int overall_depth = weight_overall(rec_depth, loop_depth);
+ {
+ int rec_depth = get_irg_recursion_depth(irg);
+ int loop_depth = get_irg_loop_depth(irg);
+ int overall_depth = weight_overall(rec_depth, loop_depth);
- int max_rec_depth = irp->max_callgraph_recursion_depth;
- int max_loop_depth = irp->max_callgraph_loop_depth;
- int max_overall_depth = weight_overall(max_rec_depth, max_loop_depth);
+ int max_rec_depth = irp->max_callgraph_recursion_depth;
+ int max_loop_depth = irp->max_callgraph_loop_depth;
+ int max_overall_depth = weight_overall(max_rec_depth, max_loop_depth);
- /* int my_rec_color = compute_color(rec_depth, max_rec_depth); */
- /* int my_loop_color = compute_color(loop_depth, max_loop_depth); */
- int my_overall_color = compute_color(overall_depth, max_overall_depth);;
+ /* int my_rec_color = compute_color(rec_depth, max_rec_depth); */
+ /* int my_loop_color = compute_color(loop_depth, max_loop_depth); */
+ int my_overall_color = compute_color(overall_depth, max_overall_depth);;
- return my_overall_color;
+ return my_overall_color;
+ }
}
void dump_callgraph(const char *suffix) {
/* Causes indeterministic output: if (is_Block(n)) fprintf (F, "\t ->%d", (int)get_irn_link(n)); */
if (has_backedges(n)) fprintf(F, "\t loop head!");
} else { /* for callgraph loop tree */
+ ir_graph *n;
assert(get_kind(son) == k_ir_graph);
+
/* We are a loop node -> Collect firm graphs */
- ir_graph *n = (ir_graph *)le.node;
+ n = (ir_graph *)le.node;
if (!loop_node_started) {
/* Start a new node which contains all firm nodes of the current loop */
fprintf (F, "node: { title: \"");
first = i;
}
else
- fprintf(F, "\n");
+ fprintf(F, "\n");
fprintf (F, " %s", get_irg_dump_name(n));
/* fprintf (F, " %s (depth %d)", get_irg_dump_name(n), n->callgraph_weighted_loop_depth); */
}