X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fbeifg_list.c;h=5c03a85e509f258c08026edd1b8407ab41a1cb5d;hb=dd4cd761ab637d4488c7e29f49843b1b02366acf;hp=7624d655bce959783957929e7de78faebece40ee;hpb=39f3a8dbd0f00f90b7b12a849d1bf7b9c1329479;p=libfirm diff --git a/ir/be/beifg_list.c b/ir/be/beifg_list.c index 7624d655b..5c03a85e5 100644 --- a/ir/be/beifg_list.c +++ b/ir/be/beifg_list.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1995-2007 University of Karlsruhe. All right reserved. + * Copyright (C) 1995-2008 University of Karlsruhe. All right reserved. * * This file is part of libFirm. * @@ -30,7 +30,6 @@ #include -#include "benodesets.h" #include "list.h" #include "irnode_t.h" @@ -171,10 +170,12 @@ static void find_neighbour_walker(ir_node *bl, void *data) { ifg_list_t *ifg = data; struct list_head *head = get_block_border_head(ifg->env, bl); - nodeset *live = new_nodeset(ifg->env->cls->n_regs); + ir_nodeset_t live; ir_node *live_irn = NULL; border_t *b = NULL; + ir_nodeset_init(&live); + assert(is_Block(bl) && "There is no block to work on"); foreach_border_head(head, b) /* follow the borders of each block */ @@ -182,10 +183,12 @@ static void find_neighbour_walker(ir_node *bl, void *data) if (b->is_def) { create_node(ifg, b->irn); /* add the node to the array of all nodes of this ifg implementation */ - nodeset_insert(live, b->irn); + ir_nodeset_insert(&live, b->irn); if (b->is_real) /* this is a new node */ { - foreach_nodeset(live, live_irn) + ir_nodeset_iterator_t iter; + + foreach_ir_nodeset(&live, live_irn, iter) { if (b->irn != live_irn) /* add a as a neighbour to b and vice versa */ add_edge(ifg, b->irn, live_irn); @@ -194,13 +197,11 @@ static void find_neighbour_walker(ir_node *bl, void *data) } else /* b->irn is now dead */ { - if (nodeset_find(live, b->irn)) - nodeset_remove(live, b->irn); + ir_nodeset_remove(&live, b->irn); } } - if (live) - del_nodeset(live); + ir_nodeset_destroy(&live); } static ir_node *get_first_node(const ifg_list_t *ifg, nodes_iter_t *it) @@ -362,12 +363,14 @@ static ir_node *ifg_list_nodes_begin(const void *self, void *iter) static ir_node *ifg_list_nodes_next(const void *self, void *iter) { + (void) self; return get_next_node(iter); } static void ifg_list_nodes_break(const void *self, void *iter) { nodes_iter_t *it = iter; + (void) self; it->curr_node_idx = 0; it->ifg = NULL; } @@ -380,12 +383,14 @@ static ir_node *ifg_list_neighbours_begin(const void *self, void *iter,const ir_ static ir_node *ifg_list_neighbours_next(const void *self, void *iter) { + (void) self; return get_next_neighbour(iter); } static void ifg_list_neighbours_break(const void *self, void *iter) { adj_iter_t *it= iter; + (void) self; it->curr_adj_element = NULL; it->ifg = NULL; }