Commit 87aee676 by Diego Novillo Committed by Diego Novillo

c-common.c (walk_stmt_tree): Visit the chain of the current tree even if walk_subtrees is 0.

2001-02-27  Diego Novillo  <dnovillo@redhat.com>

	* c-common.c (walk_stmt_tree): Visit the chain of the current tree
	even if walk_subtrees is 0.
	* c-semantics.c (prune_unused_decls): Return a non-null value to
	stop traversing the tree chain.

From-SVN: r40106
parent 67935d3f
2001-02-27 Diego Novillo <dnovillo@redhat.com>
* c-common.c (walk_stmt_tree): Visit the chain of the current tree
even if walk_subtrees is 0.
* c-semantics.c (prune_unused_decls): Return a non-null value to
stop traversing the tree chain.
2001-02-27 DJ Delorie <dj@redhat.com> 2001-02-27 DJ Delorie <dj@redhat.com>
* config/m68k/m68k.c (output_function_prologue): Save the new CFA * config/m68k/m68k.c (output_function_prologue): Save the new CFA
......
...@@ -3797,25 +3797,25 @@ walk_stmt_tree (tp, func, data) ...@@ -3797,25 +3797,25 @@ walk_stmt_tree (tp, func, data)
if (result) if (result)
return result; return result;
/* Even if we didn't, FUNC may have decided that there was nothing
interesting below this point in the tree. */
if (!walk_subtrees)
return NULL_TREE;
/* FUNC may have modified the tree, recheck that we're looking at a /* FUNC may have modified the tree, recheck that we're looking at a
statement node. */ statement node. */
code = TREE_CODE (*tp); code = TREE_CODE (*tp);
if (!statement_code_p (code)) if (!statement_code_p (code))
return NULL_TREE; return NULL_TREE;
/* Walk over all the sub-trees of this operand. Statement nodes never /* Visit the subtrees unless FUNC decided that there was nothing
contain RTL, and we needn't worry about TARGET_EXPRs. */ interesting below this point in the tree. */
len = TREE_CODE_LENGTH (code); if (walk_subtrees)
{
/* Go through the subtrees. We need to do this in forward order so /* Walk over all the sub-trees of this operand. Statement nodes
that the scope of a FOR_EXPR is handled properly. */ never contain RTL, and we needn't worry about TARGET_EXPRs. */
for (i = 0; i < len; ++i) len = TREE_CODE_LENGTH (code);
WALK_SUBTREE (TREE_OPERAND (*tp, i));
/* 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 /* Finally visit the chain. This can be tail-recursion optimized if
we write it this way. */ we write it this way. */
......
...@@ -151,10 +151,7 @@ prune_unused_decls (tp, walk_subtrees, data) ...@@ -151,10 +151,7 @@ prune_unused_decls (tp, walk_subtrees, data)
tree t = *tp; tree t = *tp;
if (t == NULL_TREE) if (t == NULL_TREE)
{ return (tree) 1;
*walk_subtrees = 0;
return NULL_TREE;
}
if (TREE_CODE (t) == DECL_STMT) if (TREE_CODE (t) == DECL_STMT)
{ {
......
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