diff options
author | Jerry Quinn <jlquinn@optonline.net> | 2009-10-30 05:17:50 +0000 |
---|---|---|
committer | Jerry Quinn <jlquinn@gcc.gnu.org> | 2009-10-30 05:17:50 +0000 |
commit | 1e43a145b1aa22f00f519a0096a38de8ff81e423 (patch) | |
tree | 3e48079c89ef88e63d587c9282415e1ead2144f6 /libstdc++-v3 | |
parent | 6581b14bdfe9e2c1cd1a6f205def403f6d8ea92f (diff) | |
download | gcc-1e43a145b1aa22f00f519a0096a38de8ff81e423.tar.gz |
mangle.c (mangle_type_string_for_rtti): Revert r149964.
2009-10-28 Jerry Quinn <jlquinn@optonline.net>
* mangle.c (mangle_type_string_for_rtti): Revert r149964.
(needs_fake_anon): Likewise.
(write_name): Likewise.
(write_nested_name): Likewise.
* cp-tree.h (mangle_type_string_for_rtti): Likewise.
(get_anonymous_namespace): Likewise.
* name-lookup.c (get_anonymous_namespace_name): Likewise.
* rtti.c (tinfo_name): Insert '*' in front of private names.
(tinfo_base_init): Use it.
2009-10-28 Jerry Quinn <jlquinn@optonline.net>
* libsupc++/tinfo.cc (operator=(const type_info&)): Compare by
pointer if name begins with '*'.
* libsupc++/typeinfo (type_info::name()): Likewise.
* libsupc++/tinfo2.cc (before): Likewise.
From-SVN: r153734
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/tinfo.cc | 3 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/tinfo2.cc | 3 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/typeinfo | 9 |
4 files changed, 17 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 402d7fb87e4..972a44d88a0 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2009-10-28 Jerry Quinn <jlquinn@optonline.net> + + * libsupc++/tinfo.cc (operator=(const type_info&)): Compare by + pointer if name begins with '*'. + * libsupc++/typeinfo (type_info::name()): Likewise. + * libsupc++/tinfo2.cc (before): Likewise. + 2009-10-29 Paolo Carlini <paolo.carlini@oracle.com> Douglas Gregor <doug.gregor@gmail.com> diff --git a/libstdc++-v3/libsupc++/tinfo.cc b/libstdc++-v3/libsupc++/tinfo.cc index 1ce6f8f46ab..d939a3fdab7 100644 --- a/libstdc++-v3/libsupc++/tinfo.cc +++ b/libstdc++-v3/libsupc++/tinfo.cc @@ -41,7 +41,8 @@ operator== (const std::type_info& arg) const #if __GXX_MERGED_TYPEINFO_NAMES return name () == arg.name (); #else - return (&arg == this) || (__builtin_strcmp (name (), arg.name ()) == 0); + return (&arg == this) + || (name ()[0] != '*' && (__builtin_strcmp (name (), arg.name ()) == 0)); #endif } diff --git a/libstdc++-v3/libsupc++/tinfo2.cc b/libstdc++-v3/libsupc++/tinfo2.cc index 4b01037f3b9..0182c6cc0de 100644 --- a/libstdc++-v3/libsupc++/tinfo2.cc +++ b/libstdc++-v3/libsupc++/tinfo2.cc @@ -37,7 +37,8 @@ type_info::before (const type_info &arg) const #if __GXX_MERGED_TYPEINFO_NAMES return name () < arg.name (); #else - return __builtin_strcmp (name (), arg.name ()) < 0; + return (name ()[0] == '*') ? name () < arg.name () + : __builtin_strcmp (name (), arg.name ()) < 0; #endif } diff --git a/libstdc++-v3/libsupc++/typeinfo b/libstdc++-v3/libsupc++/typeinfo index 4c470430def..f7f9d4e2cc2 100644 --- a/libstdc++-v3/libsupc++/typeinfo +++ b/libstdc++-v3/libsupc++/typeinfo @@ -94,7 +94,7 @@ namespace std /** Returns an @e implementation-defined byte string; this is not * portable between compilers! */ const char* name() const - { return __name; } + { return __name[0] == '*' ? __name + 1 : __name; } #if !__GXX_TYPEINFO_EQUALITY_INLINE // In old abi, or when weak symbols are not supported, there can @@ -110,12 +110,15 @@ namespace std // we can run into cases where type_info names aren't merged, // so we still need to do string comparison. bool before(const type_info& __arg) const - { return __builtin_strcmp (__name, __arg.__name) < 0; } + { return (__name[0] == '*' && __arg.__name[0] == '*') + ? __name < __arg.__name + : __builtin_strcmp (__name, __arg.__name) < 0; } bool operator==(const type_info& __arg) const { return ((__name == __arg.__name) - || __builtin_strcmp (__name, __arg.__name) == 0); + || (__name[0] != '*' && + __builtin_strcmp (__name, __arg.__name) == 0)); } #else // On some targets we can rely on type_info's NTBS being unique, |