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;
}
}
-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;
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);
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);
#include "irgraph.h"
#include "irnode.h"
-#include "dfs.h"
typedef enum {
lv_chk_state_in = 1,
/**
* 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.
#include "irdump_t.h"
#include "irnodeset.h"
-#include "dfs_t.h"
#include "absgraph.h"
#include "statev.h"
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;
be_liveness_invalidate(lv);
#ifdef USE_LIVE_CHK
lv_chk_free(lv->lvc);
- dfs_free(lv->dfs);
#endif
xfree(lv);
}