summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beverify.c
diff options
context:
space:
mode:
authorChristoph Mallon <mallon@cs.uni-saarland.de>2014-12-30 22:27:37 +0100
committerChristoph Mallon <mallon@cs.uni-saarland.de>2014-12-30 23:52:47 +0100
commitbf20bdf86ae141d53c11a25da65c609a755e79fb (patch)
tree11403b43107f25b14c6464b806439cfd3d31bb18 /ir/be/beverify.c
parent2a1612e6a84aa8ca2117536137864f3b4152f3d0 (diff)
beverify: Unbreak be_liveness_check().
Diffstat (limited to 'ir/be/beverify.c')
-rw-r--r--ir/be/beverify.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/ir/be/beverify.c b/ir/be/beverify.c
index c392cad..fd76c2a 100644
--- a/ir/be/beverify.c
+++ b/ir/be/beverify.c
@@ -730,8 +730,8 @@ bool be_verify_register_allocation(ir_graph *irg, bool new_ignore_sp_problems)
/*--------------------------------------------------------------------------- */
typedef struct lv_walker_t {
- be_lv_t *lv;
- void *data;
+ be_lv_t *given;
+ be_lv_t *fresh;
} lv_walker_t;
static const char *lv_flags_to_str(unsigned flags)
@@ -752,11 +752,9 @@ static const char *lv_flags_to_str(unsigned flags)
static void lv_check_walker(ir_node *bl, void *data)
{
- lv_walker_t *w = (lv_walker_t*)data;
- be_lv_t *fresh = (be_lv_t*)w->data;
-
- be_lv_info_t *curr = ir_nodehashmap_get(be_lv_info_t, &lv->map, bl);
- be_lv_info_t *fr = ir_nodehashmap_get(be_lv_info_t, &fresh->map, bl);
+ lv_walker_t *const w = (lv_walker_t*)data;
+ be_lv_info_t *const curr = ir_nodehashmap_get(be_lv_info_t, &w->given->map, bl);
+ be_lv_info_t *const fr = ir_nodehashmap_get(be_lv_info_t, &w->fresh->map, bl);
if (!fr && curr && curr[0].head.n_members > 0) {
ir_fprintf(stderr, "%+F liveness should be empty but current liveness contains:\n", bl);
@@ -787,11 +785,12 @@ static void lv_check_walker(ir_node *bl, void *data)
void be_liveness_check(be_lv_t *lv)
{
- lv_walker_t w;
- be_lv_t *fresh = be_liveness_new(lv->irg);
-
- w.lv = lv;
- w.data = fresh;
+ be_lv_t *const fresh = be_liveness_new(lv->irg);
+ be_liveness_compute_sets(fresh);
+ lv_walker_t w = {
+ .given = lv,
+ .fresh = fresh,
+ };
irg_block_walk_graph(lv->irg, lv_check_walker, NULL, &w);
be_liveness_free(fresh);
}