summaryrefslogtreecommitdiffhomepage
path: root/ir/be/belive.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2012-12-17 12:22:58 +0100
committerChristoph Mallon <christoph.mallon@gmx.de>2012-12-17 12:23:40 +0100
commit39d27142301974fb4de82cf484aee9e241226d93 (patch)
tree13f0ccfdedfee39ff62e87ffa03b995187123132 /ir/be/belive.c
parent831e040d95f74da41bd6f0c1946ed0b2f2cf5423 (diff)
belive: Inline be_lv_remove() into its only caller.
Diffstat (limited to 'ir/be/belive.c')
-rw-r--r--ir/be/belive.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/ir/be/belive.c b/ir/be/belive.c
index a381fd5..383df75 100644
--- a/ir/be/belive.c
+++ b/ir/be/belive.c
@@ -156,15 +156,19 @@ static be_lv_info_node_t *be_lv_get_or_set(be_lv_t *li, ir_node *bl,
return res;
}
+typedef struct lv_remove_walker_t {
+ be_lv_t *lv;
+ ir_node const *irn;
+} lv_remove_walker_t;
+
/**
* Removes a node from the list of live variables of a block.
- * @return 1 if the node was live at that block, 0 if not.
*/
-static int be_lv_remove(be_lv_t *li, const ir_node *bl,
- const ir_node *irn)
+static void lv_remove_irn_walker(ir_node *const bl, void *const data)
{
- be_lv_info_t *irn_live = ir_nodehashmap_get(be_lv_info_t, &li->map, bl);
-
+ lv_remove_walker_t *const w = (lv_remove_walker_t*)data;
+ ir_node const *const irn = w->irn;
+ be_lv_info_t *const irn_live = ir_nodehashmap_get(be_lv_info_t, &w->lv->map, bl);
if (irn_live != NULL) {
unsigned n = irn_live[0].head.n_members;
unsigned pos = _be_liveness_bsearch(irn_live, irn);
@@ -183,11 +187,8 @@ static int be_lv_remove(be_lv_t *li, const ir_node *bl,
--irn_live[0].head.n_members;
DBG((dbg, LEVEL_3, "\tdeleting %+F from %+F at pos %d\n", irn, bl, pos));
- return 1;
}
}
-
- return 0;
}
static struct {
@@ -230,12 +231,6 @@ static void live_end_at_block(ir_node *const block, be_lv_state_t const state)
}
}
-typedef struct lv_remove_walker_t {
- be_lv_t *lv;
- const ir_node *irn;
-} lv_remove_walker_t;
-
-
/**
* Liveness analysis for a value.
* Compute the set of all blocks a value is live in.
@@ -295,12 +290,6 @@ static void liveness_for_node(ir_node *irn)
}
}
-static void lv_remove_irn_walker(ir_node *bl, void *data)
-{
- lv_remove_walker_t *w = (lv_remove_walker_t*)data;
- be_lv_remove(w->lv, bl, w->irn);
-}
-
/**
* Walker, collect all nodes for which we want calculate liveness info
* on an obstack.