aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog10
-rw-r--r--gcc/cp/cp-tree.h2
-rw-r--r--gcc/cp/decl2.c3
-rw-r--r--gcc/cp/name-lookup.c9
4 files changed, 17 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index aca50f8..8a26141 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,15 @@
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
instead of build_function_type.
* decl.c (cxx_init_decl_processing): Likewise.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index eaf3459..adff616 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -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;
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index a33751c..691c1db 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -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)
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