ptr_head_t *curr_ptr_head;
ptr_element_t *curr_element;
pmap *node_map;
- bitset_t *visited_neighbours;
} ifg_pointer_t;
typedef struct _ptr_iter_t {
ir_node *curr_irn;
int get_first;
int sub_call;
+ bitset_t *visited_neighbours;
} ptr_iter_t;
/* PRIVATE FUNCTIONS */
if (res && !it->sub_call)
{
- if (bitset_contains_irn(it->ifg->visited_neighbours, res) || res == it->irn)
+ if (bitset_contains_irn(it->visited_neighbours, res) || res == it->irn)
{
res = get_next_neighbour(it);
}
else
{
- bitset_set(it->ifg->visited_neighbours, get_irn_idx(res));
+ bitset_set(it->visited_neighbours, get_irn_idx(res));
}
}
ir_node *res;
ptr_head_t *head;
ptr_element_t *element;
+ bitset_t *bitsetvisited_neighbours = bitset_malloc(get_irg_last_idx(ifg->env->irg));
it->ifg = ifg;
it->irn = irn;
it->get_first = 0;
it->sub_call = 0;
- bitset_clear_all(it->ifg->visited_neighbours);
+
+ it->visited_neighbours = bitsetvisited_neighbours;
head = phase_get_irn_data(&ifg->ph, irn);
if (!head)
if (res && !it->sub_call)
{
- if (bitset_contains_irn(it->ifg->visited_neighbours, res) || res == it->irn)
+ if (bitset_contains_irn(it->visited_neighbours, res) || res == it->irn)
{
res = get_next_neighbour(it);
}
else
{
- bitset_set(it->ifg->visited_neighbours, get_irn_idx(res));
+ bitset_set(it->visited_neighbours, get_irn_idx(res));
}
}
static void ifg_pointer_neighbours_break(const void *self, void *iter)
{
+ ptr_iter_t *it = iter;
+
+ bitset_free(it->visited_neighbours);
+
return;
}
be_ifg_t *be_ifg_pointer_new(const be_chordal_env_t *env)
{
ifg_pointer_t *ifg = xmalloc(sizeof(*ifg));
- bitset_t *bitsetvisited_neighbours = bitset_malloc(get_irg_last_idx(env->irg));
ifg->impl = &ifg_pointer_impl;
ifg->env = env;
- ifg->visited_neighbours = bitsetvisited_neighbours;
ifg->node_map = pmap_create(); /* to find all nodes, should be replaced by a "keywalker" of irphase */