From: froydnj Date: Mon, 9 Aug 2010 14:28:47 +0000 (+0000) Subject: * name-lookup.c (is_associated_namespace): Convert local variables X-Git-Tag: upstream/4.9.2~27402 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7c533e5efb8f94d48786f15ce8a68a42b3376736;p=platform%2Fupstream%2Flinaro-gcc.git * name-lookup.c (is_associated_namespace): Convert local variables to be VECs instead of TREE_LISTs. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163034 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3f50885..82f907e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2010-08-09 Nathan Froyd + * name-lookup.c (is_associated_namespace): Convert local variables + to be VECs instead of TREE_LISTs. + +2010-08-09 Nathan Froyd + * tree.c (varargs_function_p): Use stdarg_p. 2010-08-07 Nathan Froyd diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index c6e31c29..01f29e4 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4659,25 +4659,38 @@ add_function (struct arg_lookup *k, tree fn) bool is_associated_namespace (tree current, tree scope) { - tree seen = NULL_TREE; - tree todo = NULL_TREE; + VEC(tree,gc) *seen = make_tree_vector (); + VEC(tree,gc) *todo = make_tree_vector (); tree t; + bool ret; + while (1) { 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)) - if (!purpose_member (TREE_PURPOSE (t), seen)) - todo = tree_cons (TREE_PURPOSE (t), NULL_TREE, todo); - if (todo) + if (!vec_member (TREE_PURPOSE (t), seen)) + VEC_safe_push (tree, gc, todo, TREE_PURPOSE (t)); + if (!VEC_empty (tree, todo)) { - scope = TREE_PURPOSE (todo); - todo = TREE_CHAIN (todo); + scope = VEC_last (tree, todo); + VEC_pop (tree, todo); } 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.