aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index c890c37..cdf0c13 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -47,6 +47,7 @@ static tree mark_local_for_remap_r PARAMS ((tree *, int *, void *));
static tree cp_unsave_r PARAMS ((tree *, int *, void *));
static void cp_unsave PARAMS ((tree *));
static tree build_target_expr PARAMS ((tree, tree));
+static tree count_trees_r PARAMS ((tree *, int *, void *));
/* If REF is an lvalue, returns the kind of lvalue that REF is.
Otherwise, returns clk_none. If TREAT_CLASS_RVALUES_AS_LVALUES is
@@ -1396,15 +1397,15 @@ walk_tree (tp, func, data)
#undef WALK_SUBTREE
}
-int n_trees;
+/* Called from count_trees via walk_tree. */
static tree
count_trees_r (tp, walk_subtrees, data)
tree *tp ATTRIBUTE_UNUSED;
int *walk_subtrees ATTRIBUTE_UNUSED;
- void *data ATTRIBUTE_UNUSED;
+ void *data;
{
- ++n_trees;
+ ++ *((int*) data);
return NULL_TREE;
}
@@ -1415,8 +1416,8 @@ int
count_trees (t)
tree t;
{
- n_trees = 0;
- walk_tree (&t, count_trees_r, NULL);
+ int n_trees = 0;
+ walk_tree (&t, count_trees_r, &n_trees);
return n_trees;
}