]> gcc.gnu.org Git - gcc.git/commitdiff
c-common.c (walk_stmt_tree): Visit the chain of the current tree even if walk_subtree...
authorDiego Novillo <dnovillo@redhat.com>
Wed, 28 Feb 2001 01:25:42 +0000 (01:25 +0000)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Wed, 28 Feb 2001 01:25:42 +0000 (20:25 -0500)
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

gcc/ChangeLog
gcc/c-common.c
gcc/c-semantics.c

index bf6e7c57b87092351d4ebf22dc2c60295fda9fdd..7d4496a77152906ef2fb3c491244cd2e1745db4b 100644 (file)
@@ -1,3 +1,10 @@
+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>
 
        * config/m68k/m68k.c (output_function_prologue): Save the new CFA
index 7a35bffdd6123f307087e0bad1fad75ebb4828d2..3823405aedc66b53d95a10d039f656580492d0bf 100644 (file)
@@ -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.  */
index d6477f6eb4fec558c5b100e593ceff13222a3a50..bf85f7fcc138b7778e8b37443d27a148391050ae 100644 (file)
@@ -151,10 +151,7 @@ prune_unused_decls (tp, walk_subtrees, data)
   tree t = *tp;
 
   if (t == NULL_TREE)
-    {
-      *walk_subtrees = 0;
-      return NULL_TREE;
-    }
+    return (tree) 1;
 
   if (TREE_CODE (t) == DECL_STMT)
     {
This page took 0.086667 seconds and 5 git commands to generate.