aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2007-08-20 11:19:22 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2007-08-20 11:19:22 +0000
commit145881069e8d5a19e131b5c1922bdb2e27b708da (patch)
tree86faaa7d5f8b59c06113801b45f3d5eae539e5f1 /gcc/tree.c
parent412bbe81d92ba9c32a2ebd523391bb8f6637a2f7 (diff)
downloadgcc-145881069e8d5a19e131b5c1922bdb2e27b708da.zip
gcc-145881069e8d5a19e131b5c1922bdb2e27b708da.tar.gz
gcc-145881069e8d5a19e131b5c1922bdb2e27b708da.tar.bz2
tree.c (WALK_SUBTREE): Call walk_tree_1.
2007-08-20 Richard Guenther <rguenther@suse.de> * 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
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index b6b339c..61f17de 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -8233,7 +8233,7 @@ num_ending_zeros (const_tree x)
#define WALK_SUBTREE(NODE) \
do \
{ \
- result = walk_tree (&(NODE), func, data, pset); \
+ result = walk_tree_1 (&(NODE), func, data, pset, lh); \
if (result) \
return result; \
} \
@@ -8245,7 +8245,7 @@ num_ending_zeros (const_tree x)
static tree
walk_type_fields (tree type, walk_tree_fn func, void *data,
- struct pointer_set_t *pset)
+ struct pointer_set_t *pset, walk_tree_lh lh)
{
tree result = NULL_TREE;
@@ -8325,7 +8325,8 @@ walk_type_fields (tree type, walk_tree_fn func, void *data,
and to avoid visiting a node more than once. */
tree
-walk_tree (tree *tp, walk_tree_fn func, void *data, struct pointer_set_t *pset)
+walk_tree_1 (tree *tp, walk_tree_fn func, void *data,
+ struct pointer_set_t *pset, walk_tree_lh lh)
{
enum tree_code code;
int walk_subtrees;
@@ -8372,10 +8373,12 @@ walk_tree (tree *tp, walk_tree_fn func, void *data, struct pointer_set_t *pset)
return NULL_TREE;
}
- result = lang_hooks.tree_inlining.walk_subtrees (tp, &walk_subtrees, func,
- data, pset);
- if (result || !walk_subtrees)
- return result;
+ if (lh)
+ {
+ result = (*lh) (tp, &walk_subtrees, func, data, pset);
+ if (result || !walk_subtrees)
+ return result;
+ }
switch (code)
{
@@ -8529,7 +8532,7 @@ walk_tree (tree *tp, walk_tree_fn func, void *data, struct pointer_set_t *pset)
if (result || !walk_subtrees)
return result;
- result = walk_type_fields (*type_p, func, data, pset);
+ result = walk_type_fields (*type_p, func, data, pset, lh);
if (result)
return result;
@@ -8594,7 +8597,7 @@ walk_tree (tree *tp, walk_tree_fn func, void *data, struct pointer_set_t *pset)
}
/* If this is a type, walk the needed fields in the type. */
else if (TYPE_P (*tp))
- return walk_type_fields (*tp, func, data, pset);
+ return walk_type_fields (*tp, func, data, pset, lh);
break;
}
@@ -8608,13 +8611,14 @@ walk_tree (tree *tp, walk_tree_fn func, void *data, struct pointer_set_t *pset)
/* Like walk_tree, but does not walk duplicate nodes more than once. */
tree
-walk_tree_without_duplicates (tree *tp, walk_tree_fn func, void *data)
+walk_tree_without_duplicates_1 (tree *tp, walk_tree_fn func, void *data,
+ walk_tree_lh lh)
{
tree result;
struct pointer_set_t *pset;
pset = pointer_set_create ();
- result = walk_tree (tp, func, data, pset);
+ result = walk_tree_1 (tp, func, data, pset, lh);
pointer_set_destroy (pset);
return result;
}