OSDN Git Service

2005-06-09 Daniel Berlin <dberlin@dberlin.org>
[pf3gnuchains/gcc-fork.git] / gcc / tree-flow-inline.h
index 3fa6259..68f8562 100644 (file)
@@ -66,7 +66,6 @@ get_stmt_ann (tree stmt)
   return (ann) ? ann : create_stmt_ann (stmt);
 }
 
-
 /* Return the annotation type for annotation ANN.  */
 static inline enum tree_ann_type
 ann_type (tree_ann_t ann)
@@ -238,7 +237,7 @@ set_ssa_use_from_ptr (use_operand_p use, tree val)
   link_imm_use (use, val);
 }
 
-/* Link ssa_imm_use node LINKNODE into the chain for DEF, with use occuring 
+/* Link ssa_imm_use node LINKNODE into the chain for DEF, with use occurring 
    in STMT.  */
 static inline void
 link_imm_use_stmt (ssa_use_operand_t *linknode, tree def, tree stmt)
@@ -267,7 +266,7 @@ relink_imm_use (ssa_use_operand_t *node, ssa_use_operand_t *old)
     }
 }
 
-/* Relink ssa_imm_use node LINKNODE into the chain for OLD, with use occuring 
+/* Relink ssa_imm_use node LINKNODE into the chain for OLD, with use occurring 
    in STMT.  */
 static inline void
 relink_imm_use_stmt (ssa_use_operand_t *linknode, ssa_use_operand_t *old, tree stmt)
@@ -494,19 +493,12 @@ addresses_taken (tree stmt)
   return ann ? ann->addresses_taken : NULL;
 }
 
-/* Return the basic_block annotation for BB.  */
-static inline bb_ann_t
-bb_ann (basic_block bb)
-{
-  return (bb_ann_t)bb->tree_annotations;
-}
-
 /* Return the PHI nodes for basic block BB, or NULL if there are no
    PHI nodes.  */
 static inline tree
 phi_nodes (basic_block bb)
 {
-  return bb_ann (bb)->phi_nodes;
+  return bb->phi_nodes;
 }
 
 /* Set list of phi nodes of a basic block BB to L.  */
@@ -516,7 +508,7 @@ set_phi_nodes (basic_block bb, tree l)
 {
   tree phi;
 
-  bb_ann (bb)->phi_nodes = l;
+  bb->phi_nodes = l;
   for (phi = l; phi; phi = PHI_CHAIN (phi))
     set_bb_for_stmt (phi, bb);
 }
@@ -957,7 +949,7 @@ op_iter_next_tree (ssa_op_iter *ptr)
 }
 
 
-/* This functiins clears the iterator PTR, and marks it done.  This is normally
+/* This functions clears the iterator PTR, and marks it done.  This is normally
    used to prevent warnings in the compile about might be uninitailzied
    components.  */
 
@@ -1005,6 +997,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 +1008,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);
@@ -1103,7 +1097,7 @@ op_iter_init_must_and_may_def (ssa_op_iter *ptr, tree stmt,
 }
 
 
-/* If there is a single opernad in STMT matching FLAGS, return it.  Otherwise
+/* If there is a single operand in STMT matching FLAGS, return it.  Otherwise
    return NULL.  PTR is the iterator to use.  */
 static inline tree
 single_ssa_tree_operand (tree stmt, int flags)
@@ -1121,7 +1115,7 @@ single_ssa_tree_operand (tree stmt, int flags)
 }
 
 
-/* If there is a single opernad in STMT matching FLAGS, return it.  Otherwise
+/* If there is a single operand in STMT matching FLAGS, return it.  Otherwise
    return NULL.  PTR is the iterator to use.  */
 static inline use_operand_p
 single_ssa_use_operand (tree stmt, int flags)
@@ -1140,7 +1134,7 @@ single_ssa_use_operand (tree stmt, int flags)
 
 
 
-/* If there is a single opernad in STMT matching FLAGS, return it.  Otherwise
+/* If there is a single operand in STMT matching FLAGS, return it.  Otherwise
    return NULL.  PTR is the iterator to use.  */
 static inline def_operand_p
 single_ssa_def_operand (tree stmt, int flags)
@@ -1158,7 +1152,7 @@ single_ssa_def_operand (tree stmt, int flags)
 }
 
 
-/* If there is a single opernad in STMT matching FLAGS, return it.  Otherwise
+/* If there is a single operand in STMT matching FLAGS, return it.  Otherwise
    return NULL.  PTR is the iterator to use.  */
 static inline bool
 zero_ssa_operands (tree stmt, int flags)
@@ -1170,29 +1164,16 @@ zero_ssa_operands (tree stmt, int flags)
 }
 
 
-/* Return the  number of opernads mathcing FLAGS in STMT.  */
+/* Return the number of operands matching FLAGS in STMT.  */
 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)
-    num++;
-  for ( ; iter.uses; iter.uses = iter.uses->next)
-    num++;
-  for ( ; iter.vuses; iter.vuses = iter.vuses->next)
+  FOR_EACH_SSA_TREE_OPERAND (t, stmt, iter, flags)
     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;
 }
 
@@ -1285,7 +1266,7 @@ op_iter_init_phiuse (ssa_op_iter *ptr, tree phi, int flags)
 
   comp = (is_gimple_reg (phi_def) ? SSA_OP_USE : SSA_OP_VIRTUAL_USES);
     
-  /* if the PHI node deosn't the operand type we care about, we're done.  */
+  /* If the PHI node doesn't the operand type we care about, we're done.  */
   if ((flags & comp) == 0)
     {
       ptr->done = true;
@@ -1299,7 +1280,7 @@ op_iter_init_phiuse (ssa_op_iter *ptr, tree phi, int flags)
 }
 
 
-/* Start an iterator for a PHI defintion.  */
+/* Start an iterator for a PHI definition.  */
 
 static inline def_operand_p
 op_iter_init_phidef (ssa_op_iter *ptr, tree phi, int flags)
@@ -1314,7 +1295,7 @@ op_iter_init_phidef (ssa_op_iter *ptr, tree phi, int flags)
 
   comp = (is_gimple_reg (phi_def) ? SSA_OP_DEF : SSA_OP_VIRTUAL_DEFS);
     
-  /* if the PHI node deosn't the operand type we care about, we're done.  */
+  /* If the PHI node doesn't the operand type we care about, we're done.  */
   if ((flags & comp) == 0)
     {
       ptr->done = true;