summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/cp/name-lookup.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2013-12-18 19:07:29 +0000
committerpfg <pfg@FreeBSD.org>2013-12-18 19:07:29 +0000
commit6f93e9ad10bb17a8b07e0cab16df0097d5ba6090 (patch)
tree234e9f04b601b7b9c9ff48f56f79bcd379485350 /contrib/gcc/cp/name-lookup.c
parenta70f2adf579c967cdf8017632ea2266fe2e9eb4a (diff)
downloadFreeBSD-src-6f93e9ad10bb17a8b07e0cab16df0097d5ba6090.zip
FreeBSD-src-6f93e9ad10bb17a8b07e0cab16df0097d5ba6090.tar.gz
MFC r258428, r258445
gcc: another round of merges from the gcc pre-43 branch. Bring The following revisions from the gcc43 branch[1]: 118360, 118361, 118363, 118576, 119820, 123906, 125246, and 125721. They all have in common that the were merged long ago into Apple's gcc and should help improve the general quality of the compiler and make it easier to bring new features from Apple's gcc42. For details please review the additions to the files: gcc/ChangeLog.gcc43 gcc/cp/ChangeLog.gcc43 (new, adds previous revisions) Fix crosscompilation (r258445 by andreast) Reference: [1] http://gcc.gnu.org/viewcvs/gcc/trunk/?pathrev=126700 Obtained from: gcc pre4.3 (GPLv2) branch MFC after: 3 weeks
Diffstat (limited to 'contrib/gcc/cp/name-lookup.c')
-rw-r--r--contrib/gcc/cp/name-lookup.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/contrib/gcc/cp/name-lookup.c b/contrib/gcc/cp/name-lookup.c
index 744dd5c..4d08174 100644
--- a/contrib/gcc/cp/name-lookup.c
+++ b/contrib/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. */
OpenPOWER on IntegriCloud