projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup: remove firm_common_t.h (and the PRECISE_EXC_CONTEXT define)
[libfirm]
/
ir
/
be
/
beifg_list.c
diff --git
a/ir/be/beifg_list.c
b/ir/be/beifg_list.c
index
7624d65
..
5482104
100644
(file)
--- a/
ir/be/beifg_list.c
+++ b/
ir/be/beifg_list.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 1995-200
7
University of Karlsruhe. All right reserved.
+ * Copyright (C) 1995-200
8
University of Karlsruhe. All right reserved.
*
* This file is part of libFirm.
*
*
* This file is part of libFirm.
*
@@
-24,13
+24,10
@@
* @date 18.11.2005
* @version $Id$
*/
* @date 18.11.2005
* @version $Id$
*/
-#ifdef HAVE_CONFIG_H
#include "config.h"
#include "config.h"
-#endif
#include <stdlib.h>
#include <stdlib.h>
-#include "benodesets.h"
#include "list.h"
#include "irnode_t.h"
#include "list.h"
#include "irnode_t.h"
@@
-171,10
+168,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);
{
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_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 */
assert(is_Block(bl) && "There is no block to work on");
foreach_border_head(head, b) /* follow the borders of each block */
@@
-182,10
+181,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 */
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 */
{
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);
{
if (b->irn != live_irn) /* add a as a neighbour to b and vice versa */
add_edge(ifg, b->irn, live_irn);
@@
-194,13
+195,11
@@
static void find_neighbour_walker(ir_node *bl, void *data)
}
else /* b->irn is now dead */
{
}
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)
}
static ir_node *get_first_node(const ifg_list_t *ifg, nodes_iter_t *it)
@@
-362,12
+361,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)
{
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;
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;
}
it->curr_node_idx = 0;
it->ifg = NULL;
}
@@
-380,12
+381,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)
{
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;
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;
}
it->curr_adj_element = NULL;
it->ifg = NULL;
}
@@
-422,13
+425,12
@@
static const be_ifg_impl_t ifg_list_impl = {
be_ifg_t *be_ifg_list_new(const be_chordal_env_t *env)
{
be_ifg_t *be_ifg_list_new(const be_chordal_env_t *env)
{
- ifg_list_t
*ifg = xmalloc(sizeof(*ifg)
);
- adj_head_t **adj_heads_array =
xmalloc(env->irg->last_node_idx * sizeof(adj_heads_array[0])
);
+ ifg_list_t
*ifg = XMALLOC(ifg_list_t
);
+ adj_head_t **adj_heads_array =
XMALLOCNZ(adj_head_t*, env->irg->last_node_idx
);
ifg->impl = &ifg_list_impl;
ifg->env = env;
ifg->impl = &ifg_list_impl;
ifg->env = env;
- memset(adj_heads_array, 0, env->irg->last_node_idx * sizeof(adj_heads_array[0]));
ifg->adj_heads = adj_heads_array;
obstack_init(&ifg->obst);
ifg->adj_heads = adj_heads_array;
obstack_init(&ifg->obst);