aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2001-02-28 01:25:42 +0000
committerDiego Novillo <dnovillo@gcc.gnu.org>2001-02-27 20:25:42 -0500
commit87aee676f2abe6163710ed4d932eaf35e5de045c (patch)
tree2a0e66e7640bbbce0aaeac010f6b08b76136f15c /gcc/c-common.c
parent67935d3f86b738dcd382bedbb4373de98e1f9759 (diff)
downloadgcc-87aee676f2abe6163710ed4d932eaf35e5de045c.zip
gcc-87aee676f2abe6163710ed4d932eaf35e5de045c.tar.gz
gcc-87aee676f2abe6163710ed4d932eaf35e5de045c.tar.bz2
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
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 7a35bff..3823405 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -3797,25 +3797,25 @@ walk_stmt_tree (tp, func, data)
if (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
statement node. */
code = TREE_CODE (*tp);
if (!statement_code_p (code))
return NULL_TREE;
- /* 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));
+ /* 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. */