aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/name-lookup.c
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-06-09 15:34:07 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-06-09 15:34:07 +0000
commit2a4449a3b51e3a8a74111c0d0cdbfcfbf0280cc7 (patch)
treef591df14aec60eb4f3d7ef970df84e67ef698457 /gcc/cp/name-lookup.c
parent0244e6f7e07176d02c4135e64e776bc117553c90 (diff)
downloadgcc-2a4449a3b51e3a8a74111c0d0cdbfcfbf0280cc7.zip
gcc-2a4449a3b51e3a8a74111c0d0cdbfcfbf0280cc7.tar.gz
gcc-2a4449a3b51e3a8a74111c0d0cdbfcfbf0280cc7.tar.bz2
cp-tree.h (struct saved_scope): Change decl_ns_list field type to a VEC.
* cp-tree.h (struct saved_scope): Change decl_ns_list field type to a VEC. * decl2.c (cp_write_global_declarations): Adjust for new type of decl_namespace_list. * name-lookup.c (current_decl_namespace): Likewise. (push_decl_namespace): Likewise. (pop_decl_namespace): Likewise. From-SVN: r160487
Diffstat (limited to 'gcc/cp/name-lookup.c')
-rw-r--r--gcc/cp/name-lookup.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index db4246c..af6829f 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -3195,8 +3195,8 @@ current_decl_namespace (void)
{
tree result;
/* If we have been pushed into a different namespace, use it. */
- if (decl_namespace_list)
- return TREE_PURPOSE (decl_namespace_list);
+ if (!VEC_empty (tree, decl_namespace_list))
+ return VEC_last (tree, decl_namespace_list);
if (current_class_type)
result = decl_namespace_context (current_class_type);
@@ -3380,8 +3380,7 @@ push_decl_namespace (tree decl)
{
if (TREE_CODE (decl) != NAMESPACE_DECL)
decl = decl_namespace_context (decl);
- decl_namespace_list = tree_cons (ORIGINAL_NAMESPACE (decl),
- NULL_TREE, decl_namespace_list);
+ VEC_safe_push (tree, gc, decl_namespace_list, ORIGINAL_NAMESPACE (decl));
}
/* [namespace.memdef]/2 */
@@ -3389,7 +3388,7 @@ push_decl_namespace (tree decl)
void
pop_decl_namespace (void)
{
- decl_namespace_list = TREE_CHAIN (decl_namespace_list);
+ VEC_pop (tree, decl_namespace_list);
}
/* Return the namespace that is the common ancestor