c-common.c (walk_stmt_tree): Remove.
authorKazu Hirata <kazu@cs.umass.edu>
Sun, 14 Nov 2004 12:53:30 +0000 (12:53 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Sun, 14 Nov 2004 12:53:30 +0000 (12:53 +0000)
* c-common.c (walk_stmt_tree): Remove.
* c-common.h: Remove the corresponding prototype.

From-SVN: r90618

gcc/ChangeLog
gcc/c-common.c
gcc/c-common.h

index 82ca433c09feb0943eee3c14ac48c3c829b18aef..32f9fc90f86056f9eda7f54010401942c6a09716 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-14  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * c-common.c (walk_stmt_tree): Remove.
+       * c-common.h: Remove the corresponding prototype.
+
 2004-11-13  Richard Henderson  <rth@redhat.com>
 
        * calls.c (precompute_register_parameters): Force all PARALLELs
index 413508e50dd71bc56c2588f5744d2519cc0505a1..c82a8a4fc6d4c0e8e55cf07eeb7537886e504f71 100644 (file)
@@ -3398,76 +3398,6 @@ strip_pointer_operator (tree t)
   return t;
 }
 
-/* Walk the statement tree, rooted at *tp.  Apply FUNC to all the
-   sub-trees of *TP in a pre-order traversal.  FUNC is called with the
-   DATA and the address of each sub-tree.  If FUNC returns a non-NULL
-   value, the traversal is aborted, and the value returned by FUNC is
-   returned.  If FUNC sets WALK_SUBTREES to zero, then the subtrees of
-   the node being visited are not walked.
-
-   We don't need a without_duplicates variant of this one because the
-   statement tree is a tree, not a graph.  */
-
-tree
-walk_stmt_tree (tree *tp, walk_tree_fn func, void *data)
-{
-  enum tree_code code;
-  int walk_subtrees;
-  tree result;
-  int i, len;
-
-#define WALK_SUBTREE(NODE)                             \
-  do                                                   \
-    {                                                  \
-      result = walk_stmt_tree (&(NODE), func, data);   \
-      if (result)                                      \
-       return result;                                  \
-    }                                                  \
-  while (0)
-
-  /* Skip empty subtrees.  */
-  if (!*tp)
-    return NULL_TREE;
-
-  /* Skip subtrees below non-statement nodes.  */
-  if (!STATEMENT_CODE_P (TREE_CODE (*tp)))
-    return NULL_TREE;
-
-  /* Call the function.  */
-  walk_subtrees = 1;
-  result = (*func) (tp, &walk_subtrees, data);
-
-  /* If we found something, return it.  */
-  if (result)
-    return result;
-
-  /* FUNC may have modified the tree, recheck that we're looking at a
-     statement node.  */
-  code = TREE_CODE (*tp);
-  if (!STATEMENT_CODE_P (code))
-    return NULL_TREE;
-
-  /* Visit the subtrees unless FUNC decided that there was nothing
-     interesting below this point in the tree.  */
-  if (walk_subtrees)
-    {
-      /* Walk over all the sub-trees of this operand.  Statement nodes
-        never contain RTL, and we needn't worry about TARGET_EXPRs.  */
-      len = TREE_CODE_LENGTH (code);
-
-      /* Go through the subtrees.  We need to do this in forward order so
-        that the scope of a FOR_EXPR is handled properly.  */
-      for (i = 0; i < len; ++i)
-       WALK_SUBTREE (TREE_OPERAND (*tp, i));
-    }
-
-  /* Finally visit the chain.  This can be tail-recursion optimized if
-     we write it this way.  */
-  return walk_stmt_tree (&TREE_CHAIN (*tp), func, data);
-
-#undef WALK_SUBTREE
-}
-
 /* Used to compare case labels.  K1 and K2 are actually tree nodes
    representing case labels, or NULL_TREE for a `default' label.
    Returns -1 if K1 is ordered before K2, -1 if K1 is ordered after
index 1406177514e28ecde57459764ceabcc255eaefa4..8a788702682ad2b105becd7090285d2107ffd853 100644 (file)
@@ -299,7 +299,6 @@ extern tree pop_stmt_list (tree);
 extern tree add_stmt (tree);
 extern void push_cleanup (tree, tree, bool);
 
-extern tree walk_stmt_tree (tree *, walk_tree_fn, void *);
 extern int c_expand_decl (tree);
 
 extern int field_decl_cmp (const void *, const void *);