]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cp-tree.h (struct saved_scope): Change decl_ns_list field type to a VEC.
authorNathan Froyd <froydnj@codesourcery.com>
Wed, 9 Jun 2010 15:34:07 +0000 (15:34 +0000)
committerNathan Froyd <froydnj@gcc.gnu.org>
Wed, 9 Jun 2010 15:34:07 +0000 (15:34 +0000)
* 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

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl2.c
gcc/cp/name-lookup.c

index aca50f84c35716767c58d87e639bf2cca54320b6..8a261416f1c75089cb0fb1468cd42f12114ca67d 100644 (file)
@@ -1,3 +1,13 @@
+2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
+
+       * 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.
+
 2010-06-09  Nathan Froyd  <froydnj@codesourcery.com>
 
        * call.c (build_java_interface_fn_ref): Call build_function_type_list
index eaf34591cc9ba4cc828da950cfb6e2c0b49f3245..adff6168b8094bdc6aeb14bc48f4fb1c9de22594 100644 (file)
@@ -896,7 +896,7 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
 struct GTY(()) saved_scope {
   VEC(cxx_saved_binding,gc) *old_bindings;
   tree old_namespace;
-  tree decl_ns_list;
+  VEC(tree,gc) *decl_ns_list;
   tree class_name;
   tree class_type;
   tree access_specifier;
index a33751cdccf785ce3ffea65155b0d42ba475f554..691c1dbc0f3d284b7e8fd030380cd7b2a7724fe0 100644 (file)
@@ -3586,7 +3586,8 @@ cp_write_global_declarations (void)
   at_eof = 1;
 
   /* Bad parse errors.  Just forget about it.  */
-  if (! global_bindings_p () || current_class_type || decl_namespace_list)
+  if (! global_bindings_p () || current_class_type
+      || !VEC_empty (tree,decl_namespace_list))
     return;
 
   if (pch_file)
index db4246c5f70c1ef719d8c3b8268a30f9c7e0a040..af6829fc3bdf632045116a0789bca8e162bc3667 100644 (file)
@@ -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