summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bestat.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2008-10-13 08:30:49 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2008-10-13 08:30:49 +0200
commitef61b68daa8c861f51cc81e2bef989d3b71daca7 (patch)
tree136e8b1212d37d16f682a80e8b648bcef40dcc43 /ir/be/bestat.c
parent3a63cf2513b8de949d2f8433d062622817b53181 (diff)
Remove an unnecessary global variable, use the walker environment.
[r22825]
Diffstat (limited to 'ir/be/bestat.c')
-rw-r--r--ir/be/bestat.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/ir/be/bestat.c b/ir/be/bestat.c
index 4e5a9c5..af25bb4 100644
--- a/ir/be/bestat.c
+++ b/ir/be/bestat.c
@@ -153,11 +153,9 @@ double be_estimate_irg_costs(ir_graph *irg, ir_exec_freq *execfreqs)
-static be_node_stats_t *stats;
-
static void node_stat_walker(ir_node *irn, void *data)
{
- (void) data;
+ be_node_stats_t *const stats = data;
/* if the node is a normal phi */
if(is_Phi(irn)) {
@@ -184,10 +182,8 @@ static void node_stat_walker(ir_node *irn, void *data)
void be_collect_node_stats(be_node_stats_t *new_stats, be_irg_t *birg)
{
- stats = new_stats;
-
- memset(stats, 0, sizeof(*stats));
- irg_walk_graph(birg->irg, NULL, node_stat_walker, NULL);
+ memset(new_stats, 0, sizeof(*new_stats));
+ irg_walk_graph(birg->irg, NULL, node_stat_walker, new_stats);
}
void be_subtract_node_stats(be_node_stats_t *stats, be_node_stats_t *sub)