From 145881069e8d5a19e131b5c1922bdb2e27b708da Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Mon, 20 Aug 2007 11:19:22 +0000 Subject: tree.c (WALK_SUBTREE): Call walk_tree_1. 2007-08-20 Richard Guenther * tree.c (WALK_SUBTREE): Call walk_tree_1. (walk_type_fields): Take lh parameter. (walk_tree): Rename to ... (walk_tree_1): ... this. Do not call the walk_subtrees langhook but the now passed callback. Pass lh on recursion. (walk_tree_without_duplicates): Rename to ... (walk_tree_without_duplicates_1): ... this. Take lh parameter and call walk_tree_1. * tree.h (walk_tree_lh): New typedef. (walk_tree_1): Declare. (walk_tree_without_duplicates_1): Likewise. (walk_tree): New define to walk_tree_1 with NULL lh parameter. (walk_tree_without_duplicates): New define to walk_tree_without_duplicates_1 with NULL lh parameter. * langhooks.c (lhd_tree_inlining_walk_subtrees): Remove. * langhooks.h (lang_hooks_for_tree_inlining): Remove walk_subtrees langhook. * langhooks-def.h (lhd_tree_inlining_walk_subtrees): Remove. (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Likewise. (LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove walk_subtrees initializer. java/ * lang.c (java_tree_inlining_walk_subtrees): Remove. (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Remove. cp/ * cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_WALK_SUBTREES): Remove define. * tree.h (cp_walk_tree): New define to walk_tree_1 with cp_walk_subtrees lh parameter. (cp_walk_tree_without_duplicates): New define to walk_tree_without_duplicates_1 with cp_walk_subtrees lh parameter. * tree.c (count_trees): Call cp_walk_tree_without_duplicates. (verify_stmt_tree): Call cp_walk_tree. (break_out_target_exprs): Likewise. (WALK_SUBTREE): Likewise. * cp-gimplify.c (cp_genericize): Likewise. * cp-pt.c (find_parameter_packs_r): Likewise. (uses_parameter_packs): Likewise. (make_pack_expansion): Likewise. (check_for_bare_parameter_packs): Likewise. (for_each_template_parm): Likewise. * decl.c (check_default_argument): Call cp_walk_tree_without_duplicates. * except.c (build_throw): Likewise. * decl2.c (type_visibility): Likewise. * semantics.c (expand_or_defer_fn): Likewise. (finalize_nrv): Call cp_walk_tree. From-SVN: r127642 --- gcc/tree.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'gcc/tree.h') diff --git a/gcc/tree.h b/gcc/tree.h index 7b62a16..b8e960b 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -5026,8 +5026,20 @@ struct pointer_set_t; /* The type of a callback function for walking over tree structure. */ typedef tree (*walk_tree_fn) (tree *, int *, void *); -extern tree walk_tree (tree*, walk_tree_fn, void*, struct pointer_set_t*); -extern tree walk_tree_without_duplicates (tree*, walk_tree_fn, void*); + +/* The type of a callback function that represents a custom walk_tree. */ + +typedef tree (*walk_tree_lh) (tree *, int *, tree (*) (tree *, int *, void *), + void *, struct pointer_set_t*); + +extern tree walk_tree_1 (tree*, walk_tree_fn, void*, struct pointer_set_t*, + walk_tree_lh); +extern tree walk_tree_without_duplicates_1 (tree*, walk_tree_fn, void*, + walk_tree_lh); +#define walk_tree(a,b,c,d) \ + walk_tree_1 (a, b, c, d, NULL) +#define walk_tree_without_duplicates(a,b,c) \ + walk_tree_without_duplicates_1 (a, b, c, NULL) /* Assign the RTX to declaration. */ -- cgit v1.1