Commit 158ab9a1 authored by Michael Beck's avatar Michael Beck
Browse files

- add an assert tat checks for backend phase when added dep edges

- edges_activate()/edges_deactivate() handles DEP edges only in BACKEND phase

[r20731]
parent a2c2cb1a
......@@ -881,11 +881,13 @@ void edges_init_dbg(int do_dbg) {
void edges_activate(ir_graph *irg) {
edges_activate_kind(irg, EDGE_KIND_NORMAL);
edges_activate_kind(irg, EDGE_KIND_BLOCK);
edges_activate_kind(irg, EDGE_KIND_DEP);
if (get_irg_phase_state(irg) == phase_backend)
edges_activate_kind(irg, EDGE_KIND_DEP);
}
void edges_deactivate(ir_graph *irg) {
edges_deactivate_kind(irg, EDGE_KIND_DEP);
if (get_irg_phase_state(irg) == phase_backend)
edges_deactivate_kind(irg, EDGE_KIND_DEP);
edges_deactivate_kind(irg, EDGE_KIND_BLOCK);
edges_deactivate_kind(irg, EDGE_KIND_NORMAL);
}
......
......@@ -356,6 +356,8 @@ void (set_irn_dep)(ir_node *node, int pos, ir_node *dep) {
int add_irn_dep(ir_node *node, ir_node *dep) {
int res = 0;
/* DEP edges are only allowed in backend phase */
assert(get_irg_phase_state(get_irn_irg(node)) == phase_backend);
if (node->deps == NULL) {
node->deps = NEW_ARR_F(ir_node *, 1);
node->deps[0] = dep;
......
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