From 29eb4ac9ad2c2429469e965192c9021a0f250781 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 14 Nov 2004 12:53:30 +0000 Subject: [PATCH] c-common.c (walk_stmt_tree): Remove. * c-common.c (walk_stmt_tree): Remove. * c-common.h: Remove the corresponding prototype. From-SVN: r90618 --- gcc/ChangeLog | 5 ++++ gcc/c-common.c | 70 -------------------------------------------------- gcc/c-common.h | 1 - 3 files changed, 5 insertions(+), 71 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 82ca433c09f..32f9fc90f86 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-11-14 Kazu Hirata + + * c-common.c (walk_stmt_tree): Remove. + * c-common.h: Remove the corresponding prototype. + 2004-11-13 Richard Henderson * calls.c (precompute_register_parameters): Force all PARALLELs diff --git a/gcc/c-common.c b/gcc/c-common.c index 413508e50dd..c82a8a4fc6d 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 diff --git a/gcc/c-common.h b/gcc/c-common.h index 1406177514e..8a788702682 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -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 *); -- 2.30.2