From: Matthias Braun Date: Tue, 20 Dec 2011 17:10:43 +0000 (+0100) Subject: irlivechk: remove need to pass in a DFS structure X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=51e652d857c3448114970916285fdbebecdd968b;p=libfirm irlivechk: remove need to pass in a DFS structure --- diff --git a/ir/ana/irlivechk.c b/ir/ana/irlivechk.c index 42fea5263..b64b42dfe 100644 --- a/ir/ana/irlivechk.c +++ b/ir/ana/irlivechk.c @@ -75,7 +75,7 @@ typedef struct bl_info_t { struct lv_chk_t { ir_nodemap block_infos; struct obstack obst; - const dfs_t *dfs; + dfs_t *dfs; int n_blocks; bitset_t *back_edge_src; bitset_t *back_edge_tgt; @@ -240,7 +240,7 @@ static inline void compute_back_edge_chains(lv_chk_t *lv) } } -lv_chk_t *lv_chk_new(ir_graph *irg, const dfs_t *dfs) +lv_chk_t *lv_chk_new(ir_graph *irg) { lv_chk_t *res = XMALLOC(lv_chk_t); int i; @@ -253,7 +253,7 @@ lv_chk_t *lv_chk_new(ir_graph *irg, const dfs_t *dfs) FIRM_DBG_REGISTER(res->dbg, "ir.ana.lvchk"); - res->dfs = dfs; + res->dfs = dfs_new(&absgraph_irg_cfg_succ, irg); res->n_blocks = dfs_get_n_nodes(res->dfs); res->back_edge_src = bitset_obstack_alloc(&res->obst, res->n_blocks); res->back_edge_tgt = bitset_obstack_alloc(&res->obst, res->n_blocks); @@ -294,6 +294,7 @@ lv_chk_t *lv_chk_new(ir_graph *irg, const dfs_t *dfs) void lv_chk_free(lv_chk_t *lv) { + dfs_free(lv->dfs); obstack_free(&lv->obst, NULL); ir_nodemap_destroy(&lv->block_infos); xfree(lv); diff --git a/ir/ana/irlivechk.h b/ir/ana/irlivechk.h index 750dd0c10..ded033b0c 100644 --- a/ir/ana/irlivechk.h +++ b/ir/ana/irlivechk.h @@ -33,7 +33,6 @@ #include "irgraph.h" #include "irnode.h" -#include "dfs.h" typedef enum { lv_chk_state_in = 1, @@ -47,10 +46,9 @@ typedef struct lv_chk_t lv_chk_t; /** * Make a new liveness check environment. * @param irg The graph. - * @param dfs A forward DFS on CFG of the given irg. * @return The environment. */ -extern lv_chk_t *lv_chk_new(ir_graph *irg, const dfs_t *dfs); +extern lv_chk_t *lv_chk_new(ir_graph *irg); /** * Free liveness check information. diff --git a/ir/be/belive.c b/ir/be/belive.c index cec151684..b5918ff49 100644 --- a/ir/be/belive.c +++ b/ir/be/belive.c @@ -34,7 +34,6 @@ #include "irdump_t.h" #include "irnodeset.h" -#include "dfs_t.h" #include "absgraph.h" #include "statev.h" @@ -533,8 +532,7 @@ be_lv_t *be_liveness(ir_graph *irg) lv->irg = irg; #ifdef USE_LIVE_CHK - lv->dfs = dfs_new(&absgraph_irg_cfg_succ, irg); - lv->lvc = lv_chk_new(lv->irg, lv->dfs); + lv->lvc = lv_chk_new(lv->irg); #endif lv->hook_info.context = lv; lv->hook_info.hook._hook_node_info = be_dump_liveness_block; @@ -570,7 +568,6 @@ void be_liveness_free(be_lv_t *lv) be_liveness_invalidate(lv); #ifdef USE_LIVE_CHK lv_chk_free(lv->lvc); - dfs_free(lv->dfs); #endif xfree(lv); } diff --git a/ir/be/belive_t.h b/ir/be/belive_t.h index cbee3e669..5b5da7055 100644 --- a/ir/be/belive_t.h +++ b/ir/be/belive_t.h @@ -30,7 +30,6 @@ #include "irgraph_t.h" #include "irnodehashmap.h" #include "irhooks.h" -#include "dfs.h" #include "statev.h" #include "pset.h" @@ -48,7 +47,6 @@ struct be_lv_t { ir_nodehashmap_t map; struct obstack obst; ir_graph *irg; - dfs_t *dfs; bitset_t *nodes; hook_entry_t hook_info; #ifdef USE_LIVE_CHK