Commit d4ccba66 by Nathan Froyd Committed by Nathan Froyd

name-lookup.c (is_associated_namespace): Convert local variables to be VECs instead of TREE_LISTs.

	* name-lookup.c (is_associated_namespace): Convert local variables
	to be VECs instead of TREE_LISTs.

From-SVN: r163034
parent f38958e8
2010-08-09 Nathan Froyd <froydnj@codesourcery.com> 2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
* name-lookup.c (is_associated_namespace): Convert local variables
to be VECs instead of TREE_LISTs.
2010-08-09 Nathan Froyd <froydnj@codesourcery.com>
* tree.c (varargs_function_p): Use stdarg_p. * tree.c (varargs_function_p): Use stdarg_p.
2010-08-07 Nathan Froyd <froydnj@codesourcery.com> 2010-08-07 Nathan Froyd <froydnj@codesourcery.com>
......
...@@ -4659,25 +4659,38 @@ add_function (struct arg_lookup *k, tree fn) ...@@ -4659,25 +4659,38 @@ add_function (struct arg_lookup *k, tree fn)
bool bool
is_associated_namespace (tree current, tree scope) is_associated_namespace (tree current, tree scope)
{ {
tree seen = NULL_TREE; VEC(tree,gc) *seen = make_tree_vector ();
tree todo = NULL_TREE; VEC(tree,gc) *todo = make_tree_vector ();
tree t; tree t;
bool ret;
while (1) while (1)
{ {
if (scope == current) if (scope == current)
return true; {
seen = tree_cons (scope, NULL_TREE, seen); ret = true;
break;
}
VEC_safe_push (tree, gc, seen, scope);
for (t = DECL_NAMESPACE_ASSOCIATIONS (scope); t; t = TREE_CHAIN (t)) for (t = DECL_NAMESPACE_ASSOCIATIONS (scope); t; t = TREE_CHAIN (t))
if (!purpose_member (TREE_PURPOSE (t), seen)) if (!vec_member (TREE_PURPOSE (t), seen))
todo = tree_cons (TREE_PURPOSE (t), NULL_TREE, todo); VEC_safe_push (tree, gc, todo, TREE_PURPOSE (t));
if (todo) if (!VEC_empty (tree, todo))
{ {
scope = TREE_PURPOSE (todo); scope = VEC_last (tree, todo);
todo = TREE_CHAIN (todo); VEC_pop (tree, todo);
} }
else else
return false; {
ret = false;
break;
}
} }
release_tree_vector (seen);
release_tree_vector (todo);
return ret;
} }
/* Add functions of a namespace to the lookup structure. /* Add functions of a namespace to the lookup structure.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment