Commit 339fc410 authored by Matthias Braun's avatar Matthias Braun
Browse files

iredges: use the same block walking behaviour as irg_block_walk

We need a consistent behaviour between irg_block_walk_graph and the
iredges block walk! This means we have to skip tuples like the
irg_block_walk_graph.

This fixes valgrind errors found in opt/fehler217.c
parent cf16446f
......@@ -83,12 +83,22 @@ typedef struct {
get_edge_src_n_func_t *get_n; /**< the get_n function */
} ir_edge_kind_info_t;
/* Walks back from n until it finds a real cf op. */
static ir_node *get_cf_op(ir_node *n)
{
while (!is_cfop(n) && !is_fragile_op(n) && !is_Bad(n)) {
n = skip_Tuple(n);
n = skip_Proj(n);
}
return n;
}
/**
* Get the predecessor block.
*/
static ir_node *get_block_n(const ir_node *block, int pos)
{
ir_node *cfgpred = get_Block_cfgpred(block, pos);
ir_node *cfgpred = get_cf_op(get_Block_cfgpred(block, pos));
if (is_Bad(cfgpred))
return NULL;
return get_nodes_block(cfgpred);
......
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