aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2004-11-14 12:53:30 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2004-11-14 12:53:30 +0000
commit29eb4ac9ad2c2429469e965192c9021a0f250781 (patch)
tree35c56416f888923b533b8b1bcb57d4f9a406e695 /gcc/c-common.c
parent6b870fa9f4de2ec9f2c30caae5f9af662ab1697c (diff)
downloadgcc-29eb4ac9ad2c2429469e965192c9021a0f250781.zip
gcc-29eb4ac9ad2c2429469e965192c9021a0f250781.tar.gz
gcc-29eb4ac9ad2c2429469e965192c9021a0f250781.tar.bz2
c-common.c (walk_stmt_tree): Remove.
* c-common.c (walk_stmt_tree): Remove. * c-common.h: Remove the corresponding prototype. From-SVN: r90618
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 413508e..c82a8a4 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -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