aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/name-lookup.c24
3 files changed, 27 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 75c2fd4..27d86cd 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2006-10-31 Geoffrey Keating <geoffk@apple.com>
+
+ * name-lookup.c (get_anonymous_namespace_name): New.
+ (push_namespace_with_attribs): Use get_anonymous_namespace_name.
+ * decl2.c (start_objects): Update for rename of
+ get_file_function_name_long.
+
2006-10-30 Dirk Mueller <dmueller@suse.de>
PR c++/28704
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 3b23638..e4b5c00 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2324,7 +2324,7 @@ start_objects (int method_type, int initp)
sprintf (type, "%c", method_type);
fndecl = build_lang_decl (FUNCTION_DECL,
- get_file_function_name_long (type),
+ get_file_function_name (type),
build_function_type (void_type_node,
void_list_node));
start_preparsed_function (fndecl, /*attrs=*/NULL_TREE, SF_PRE_PARSED);
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 3016bb0..92d398a 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -61,6 +61,24 @@ tree global_namespace;
unit. */
static GTY(()) tree anonymous_namespace_name;
+/* Initialise anonymous_namespace_name if necessary, and return it. */
+
+static tree
+get_anonymous_namespace_name(void)
+{
+ if (!anonymous_namespace_name)
+ {
+ /* The anonymous namespace has to have a unique name
+ if typeinfo objects are being compared by name. */
+ if (! flag_weak || ! SUPPORTS_ONE_ONLY)
+ anonymous_namespace_name = get_file_function_name ("N");
+ else
+ /* The demangler expects anonymous namespaces to be called
+ something starting with '_GLOBAL__N_'. */
+ anonymous_namespace_name = get_identifier ("_GLOBAL__N_1");
+ }
+ return anonymous_namespace_name;
+}
/* Compute the chain index of a binding_entry given the HASH value of its
name and the total COUNT of chains. COUNT is assumed to be a power
@@ -3011,11 +3029,7 @@ push_namespace_with_attribs (tree name, tree attributes)
if (anon)
{
- /* The name of anonymous namespace is unique for the translation
- unit. */
- if (!anonymous_namespace_name)
- anonymous_namespace_name = get_file_function_name ('N');
- name = anonymous_namespace_name;
+ name = get_anonymous_namespace_name();
d = IDENTIFIER_NAMESPACE_VALUE (name);
if (d)
/* Reopening anonymous namespace. */