This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH to walk_tree
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Subject: C++ PATCH to walk_tree
- From: Jason Merrill <jason_merrill at redhat dot com>
- Date: 07 Aug 2001 13:03:09 +0100
I noticed this while working on the NRVO; things were breaking because one
_STMT had decided not to walk its subtrees, which meant that none of the
following _STMTs were walked, either. Oops.
2001-08-07 Jason Merrill <jason_merrill@redhat.com>
* tree.c (walk_tree): Walk siblings even if !walk_subtrees.
*** tree.c.~1~ Tue Aug 7 00:49:37 2001
--- tree.c Tue Aug 7 12:54:27 2001
*************** walk_tree (tp, func, data, htab)
*** 1198,1209 ****
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;
!
! code = TREE_CODE (*tp);
/* Handle common cases up front. */
if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code))
--- 1198,1215 ----
if (result)
return result;
+ code = TREE_CODE (*tp);
+
/* Even if we didn't, FUNC may have decided that there was nothing
interesting below this point in the tree. */
if (!walk_subtrees)
! {
! if (statement_code_p (code) || code == TREE_LIST || code == OVERLOAD)
! /* But we still need to check our siblings. */
! return walk_tree (&TREE_CHAIN (*tp), func, data, htab);
! else
! return NULL_TREE;
! }
/* Handle common cases up front. */
if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code))