Commit 66d3fe47 by Andrew MacLeod Committed by Andrew Macleod

tree-flow-inline.h (op_iter_init_use, [...]): Assert that the flags are of appropriate types.


2005-05-04  Andrew MacLeod  <amacleod@redhat.com>

	* tree-flow-inline.h (op_iter_init_use, op_iter_init_def): Assert that
	the flags are of appropriate types.
	(num_ssa_operands): Generalize using the generic interface.
	* tree-ssa-dce.c (remove_dead_stmt): Don't ask for kills on a DEF
	iterator.

From-SVN: r99227
parent 158a48be
2005-05-04 Andrew MacLeod <amacleod@redhat.com>
* tree-flow-inline.h (op_iter_init_use, op_iter_init_def): Assert that
the flags are of appropriate types.
(num_ssa_operands): Generalize using the generic interface.
* tree-ssa-dce.c (remove_dead_stmt): Don't ask for kills on a DEF
iterator.
2005-05-04 Richard Sandiford <rsandifo@redhat.com>
* protoize.c (version_flag, quiet_flag, nochange_flag, nosave_flag)
......
......@@ -1005,6 +1005,7 @@ op_iter_init (ssa_op_iter *ptr, tree stmt, int flags)
static inline use_operand_p
op_iter_init_use (ssa_op_iter *ptr, tree stmt, int flags)
{
gcc_assert ((flags & SSA_OP_ALL_DEFS) == 0);
op_iter_init (ptr, stmt, flags);
ptr->iter_type = ssa_op_iter_use;
return op_iter_next_use (ptr);
......@@ -1015,6 +1016,7 @@ op_iter_init_use (ssa_op_iter *ptr, tree stmt, int flags)
static inline def_operand_p
op_iter_init_def (ssa_op_iter *ptr, tree stmt, int flags)
{
gcc_assert ((flags & (SSA_OP_ALL_USES | SSA_OP_VIRTUAL_KILLS)) == 0);
op_iter_init (ptr, stmt, flags);
ptr->iter_type = ssa_op_iter_def;
return op_iter_next_def (ptr);
......@@ -1175,24 +1177,11 @@ static inline int
num_ssa_operands (tree stmt, int flags)
{
ssa_op_iter iter;
tree t;
int num = 0;
op_iter_init (&iter, stmt, flags);
for ( ; iter.defs; iter.defs = iter.defs->next)
FOR_EACH_SSA_TREE_OPERAND (t, stmt, iter, flags)
num++;
for ( ; iter.uses; iter.uses = iter.uses->next)
num++;
for ( ; iter.vuses; iter.vuses = iter.vuses->next)
num++;
for ( ; iter.maydefs; iter.maydefs = iter.maydefs->next)
num++;
for ( ; iter.mayuses; iter.mayuses = iter.mayuses->next)
num++;
for ( ; iter.mustdefs; iter.mustdefs = iter.mustdefs->next)
num++;
for ( ; iter.mustkills; iter.mustkills = iter.mustkills->next)
num++;
return num;
}
......
......@@ -769,8 +769,7 @@ remove_dead_stmt (block_stmt_iterator *i, basic_block bb)
remove_edge (EDGE_SUCC (bb, 1));
}
FOR_EACH_SSA_DEF_OPERAND (def_p, t, iter,
SSA_OP_VIRTUAL_DEFS | SSA_OP_VIRTUAL_KILLS)
FOR_EACH_SSA_DEF_OPERAND (def_p, t, iter, SSA_OP_VIRTUAL_DEFS)
{
tree def = DEF_FROM_PTR (def_p);
mark_sym_for_renaming (SSA_NAME_VAR (def));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment