summaryrefslogtreecommitdiffhomepage
path: root/ir/be/beuses.c
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2012-08-04 14:21:16 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2012-08-08 16:16:48 +0200
commite1ef6eb2111d1efae896cef74c257f761ca68047 (patch)
tree6d324e044c919bf2f67e067fb7cfcd752b5deb3d /ir/be/beuses.c
parentac122d9decce63c3e2ff5c401d1078b6d73e17e7 (diff)
Use get_Block_cfgpred_pos().
Diffstat (limited to 'ir/be/beuses.c')
-rw-r--r--ir/be/beuses.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/ir/be/beuses.c b/ir/be/beuses.c
index 69cf44f..9b77c47 100644
--- a/ir/be/beuses.c
+++ b/ir/be/beuses.c
@@ -143,9 +143,6 @@ static const be_use_t *get_or_set_use_block(be_uses_t *env,
*/
static int be_is_phi_argument(const ir_node *block, const ir_node *def)
{
- ir_node *succ_block = NULL;
- int arity, i;
-
#if 1
if (get_irn_n_edges_kind(block, EDGE_KIND_BLOCK) < 1)
#else
@@ -153,20 +150,16 @@ static int be_is_phi_argument(const ir_node *block, const ir_node *def)
#endif
return 0;
- succ_block = get_first_block_succ(block);
+ ir_node *const succ_block = get_first_block_succ(block);
- arity = get_Block_n_cfgpreds(succ_block);
- if (arity <= 1) {
+ if (get_Block_n_cfgpreds(succ_block) <= 1) {
/* no Phis in the successor */
return 0;
}
/* find the index of block in its successor */
- for (i = 0; i < arity; ++i) {
- if (get_Block_cfgpred_block(succ_block, i) == block)
- break;
- }
- assert(i < arity);
+ int const i = get_Block_cfgpred_pos(succ_block, block);
+ assert(i >= 0);
/* iterate over the Phi nodes in the successor and check if def is
* one of its arguments */