From ef61b68daa8c861f51cc81e2bef989d3b71daca7 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Mon, 13 Oct 2008 06:30:49 +0000 Subject: [PATCH] Remove an unnecessary global variable, use the walker environment. [r22825] --- ir/be/bestat.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/ir/be/bestat.c b/ir/be/bestat.c index 4e5a9c520..af25bb4dc 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) -- 2.20.1