summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beinfo.c
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2012-11-27 18:01:39 +0100
committerMatthias Braun <matze@braunis.de>2012-11-28 11:27:13 +0100
commit9a1c04e0bdc66d8fce339bc81408728b9459d033 (patch)
tree16959fdf8ac7ffdb3379d467c54407ff7b969f69 /ir/be/beinfo.c
parent1376e7ac003f5d209b72056c62798cbb6d928de3 (diff)
make schedule dumper more robust/cleanup
Diffstat (limited to 'ir/be/beinfo.c')
-rw-r--r--ir/be/beinfo.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/ir/be/beinfo.c b/ir/be/beinfo.c
index cada5c5..fbda0b7 100644
--- a/ir/be/beinfo.c
+++ b/ir/be/beinfo.c
@@ -176,23 +176,26 @@ void be_info_init(void)
*/
static void sched_edge_hook(FILE *F, const ir_node *irn)
{
- if (get_irn_irg(irn)->be_data == NULL)
+ ir_graph *irg = get_irn_irg(irn);
+ if (!irg_is_constrained(irg, IR_GRAPH_CONSTRAINT_BACKEND))
+ return;
+
+ if (is_Proj(irn) || is_Block(irn) || !sched_is_scheduled(irn))
return;
- if (!is_Proj(irn) && sched_is_scheduled(irn) && !is_Block(irn)) {
- ir_node *const prev = sched_prev(irn);
- if (!sched_is_begin(prev)) {
- fprintf(F, "edge:{sourcename: ");
- print_nodeid(F, irn);
- fprintf(F, " targetname: ");
- print_nodeid(F, prev);
- fprintf(F, " color:magenta}\n");
- }
+ ir_node *const prev = sched_prev(irn);
+ if (!sched_is_begin(prev)) {
+ fprintf(F, "edge:{sourcename: ");
+ print_nodeid(F, irn);
+ fprintf(F, " targetname: ");
+ print_nodeid(F, prev);
+ fprintf(F, " color:magenta}\n");
}
}
void be_info_init_irg(ir_graph *irg)
{
+ add_irg_constraints(irg, IR_GRAPH_CONSTRAINT_BACKEND);
irg_walk_anchors(irg, init_walker, NULL, NULL);
set_dump_node_edge_hook(sched_edge_hook);