This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

AIX Status



Here is my current outstanding patch set for AIX.

These patches should fix most of the VTT and typeinfo problems.  I am
running tests on AIX overnight.  It is likely there are bugs, but I
think this is a good first start.  The basic idea is to make VTTs and
typeinfo static, which requires the change in typeinfo comparison
described earlier.  There are space optimizations that can be
performed, under some circumstances, but we can do that on the branch,
or not at all, depending on whether anyone has the energy.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


Index: gcc/cppinit.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cppinit.c,v
retrieving revision 1.143
diff -c -p -r1.143 cppinit.c
*** cppinit.c	2001/01/21 02:26:27	1.143
--- cppinit.c	2001/01/26 08:27:34
*************** struct builtin
*** 639,644 ****
--- 639,645 ----
  #define OPERATOR  	0x10
  
  #define B(n, t)       { U n, 0, t, 0, BUILTIN, sizeof n - 1 }
+ #define BC(n, t)      { U n, 0, t, 0, BUILTIN | CPLUS, sizeof n - 1 }
  #define C(n, v)       { U n, v, 0, 0, 0, sizeof n - 1 }
  #define X(n, f)       { U n, 0, 0, 0, f, sizeof n - 1 }
  #define O(n, c, f)    { U n, 0, 0, c, OPERATOR | f, sizeof n - 1 }
*************** static const struct builtin builtin_arra
*** 651,656 ****
--- 652,658 ----
    B("__LINE__",		 BT_SPECLINE),
    B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL),
    B("__STDC__",		 BT_STDC),
+   BC("__GXX_WEAK__",     BT_WEAK),
  
    X("__VERSION__",		VERS),
    X("__USER_LABEL_PREFIX__",	ULP),
Index: gcc/cpplib.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cpplib.h,v
retrieving revision 1.161
diff -c -p -r1.161 cpplib.h
*** cpplib.h	2001/01/14 22:00:19	1.161
--- cpplib.h	2001/01/26 08:27:35
*************** enum builtin_type
*** 461,467 ****
    BT_BASE_FILE,			/* `__BASE_FILE__' */
    BT_INCLUDE_LEVEL,		/* `__INCLUDE_LEVEL__' */
    BT_TIME,			/* `__TIME__' */
!   BT_STDC			/* `__STDC__' */
  };
  
  /* There is a slot in the hashnode for use by front ends when integrated
--- 461,469 ----
    BT_BASE_FILE,			/* `__BASE_FILE__' */
    BT_INCLUDE_LEVEL,		/* `__INCLUDE_LEVEL__' */
    BT_TIME,			/* `__TIME__' */
!   BT_STDC,			/* `__STDC__' */
!   BT_WEAK                       /* Whether or not G++ supports weak 
! 				   symbols.  */
  };
  
  /* There is a slot in the hashnode for use by front ends when integrated
Index: gcc/cppmacro.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cppmacro.c,v
retrieving revision 1.39
diff -c -p -r1.39 cppmacro.c
*** cppmacro.c	2001/01/20 09:33:01	1.39
--- cppmacro.c	2001/01/26 08:27:35
*************** Foundation, 59 Temple Place - Suite 330,
*** 28,33 ****
--- 28,34 ----
  #include "intl.h"		/* for _("<command line>") below.  */
  #include "cpplib.h"
  #include "cpphash.h"
+ #include "defaults.h"
  
  #ifndef STDC_0_IN_SYSTEM_HEADERS
  #define STDC_0_IN_SYSTEM_HEADERS 0 /* Boolean macro.  */
*************** builtin_macro (pfile, token)
*** 214,219 ****
--- 215,224 ----
  		   tb->tm_hour, tb->tm_min, tb->tm_sec);
  	}
        *token = node->value.builtin == BT_DATE ? pfile->date: pfile->time;
+       break;
+ 
+     case BT_WEAK:
+       make_number_token (pfile, token, SUPPORTS_ONE_ONLY);
        break;
  
      default:
Index: gcc/defaults.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/defaults.h,v
retrieving revision 1.28
diff -c -p -r1.28 defaults.h
*** defaults.h	2001/01/15 03:33:47	1.28
--- defaults.h	2001/01/26 08:27:35
*************** do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNA
*** 151,156 ****
--- 151,165 ----
  #endif
  #endif
  
+ /* This determines whether or not we support link-once semantics.  */
+ #ifndef SUPPORTS_ONE_ONLY
+ #ifdef MAKE_DECL_ONE_ONLY
+ #define SUPPORTS_ONE_ONLY 1
+ #else
+ #define SUPPORTS_ONE_ONLY 0
+ #endif
+ #endif
+ 
  /* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
     provide a weak attribute.  Else define it to nothing. 
  
Index: gcc/varasm.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/varasm.c,v
retrieving revision 1.158
diff -c -p -r1.158 varasm.c
*** varasm.c	2001/01/15 04:15:03	1.158
--- varasm.c	2001/01/26 08:27:41
*************** assemble_alias (decl, target)
*** 4853,4867 ****
  #endif
  }
  
- /* This determines whether or not we support link-once semantics.  */
- #ifndef SUPPORTS_ONE_ONLY
- #ifdef MAKE_DECL_ONE_ONLY
- #define SUPPORTS_ONE_ONLY 1
- #else
- #define SUPPORTS_ONE_ONLY 0
- #endif
- #endif
- 
  /* Returns 1 if the target configuration supports defining public symbols
     so that one of them will be chosen at link time instead of generating a
     multiply-defined symbol error, whether through the use of weak symbols or
--- 4853,4858 ----
Index: gcc/cp/cp-tree.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/cp-tree.h,v
retrieving revision 1.565
diff -c -p -r1.565 cp-tree.h
*** cp-tree.h	2001/01/22 13:51:42	1.565
--- cp-tree.h	2001/01/26 08:27:44
*************** struct lang_type
*** 1619,1630 ****
     `#pragma interface', and it is not included in its implementation file.  */
  #define CLASSTYPE_INTERFACE_ONLY(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_only)
  
! /* Same as above, but for classes whose purpose we do not know.  */
! #define CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown)
! #define CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown == 0)
! #define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = !!(X))
! #define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = 1)
! #define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = 0)
  
  /* Nonzero if a _DECL node requires us to output debug info for this class.  */
  #define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->debug_requested)
--- 1619,1641 ----
     `#pragma interface', and it is not included in its implementation file.  */
  #define CLASSTYPE_INTERFACE_ONLY(NODE) (TYPE_LANG_SPECIFIC(NODE)->interface_only)
  
! /* True if we have already determined whether or not vtables, VTTs,
!    typeinfo, and other similar per-class data should be emitted in
!    this translation unit.  This flag does not indicate whether or not
!    these items should be emitted; it only indicates that we know one
!    way or the other.  */
! #define CLASSTYPE_INTERFACE_KNOWN(NODE) \
!   (TYPE_LANG_SPECIFIC(NODE)->interface_unknown == 0)
! /* The opposite of CLASSTYPE_INTERFANCE_KNOWN.  */
! #define CLASSTYPE_INTERFACE_UNKNOWN(NODE) \
!   (TYPE_LANG_SPECIFIC(NODE)->interface_unknown)
! 
! #define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) \
!   (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = !!(X))
! #define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) \
!   (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = 1)
! #define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) \
!   (TYPE_LANG_SPECIFIC(NODE)->interface_unknown = 0)
  
  /* Nonzero if a _DECL node requires us to output debug info for this class.  */
  #define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->debug_requested)
Index: gcc/cp/decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.739
diff -c -p -r1.739 decl.c
*** decl.c	2001/01/19 09:24:12	1.739
--- decl.c	2001/01/26 08:27:47
*************** maybe_commonize_var (decl)
*** 7518,7525 ****
  	     which we can't if it has been initialized.  */
  
  	  if (TREE_PUBLIC (decl))
! 	    DECL_ASSEMBLER_NAME (decl)
! 	      = build_static_name (current_function_decl, DECL_NAME (decl));
  	  else
  	    {
  	      cp_warning_at ("sorry: semantics of inline function static data `%#D' are wrong (you'll wind up with multiple copies)", decl);
--- 7518,7530 ----
  	     which we can't if it has been initialized.  */
  
  	  if (TREE_PUBLIC (decl))
! 	    {
! 	      if (flag_new_abi)
! 		DECL_ASSEMBLER_NAME (decl) = mangle_decl (decl);
! 	      else
! 		DECL_ASSEMBLER_NAME (decl)
! 		  = build_static_name (current_function_decl, DECL_NAME (decl));
! 	    }
  	  else
  	    {
  	      cp_warning_at ("sorry: semantics of inline function static data `%#D' are wrong (you'll wind up with multiple copies)", decl);
Index: gcc/cp/decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.431
diff -c -p -r1.431 decl2.c
*** decl2.c	2001/01/19 21:07:21	1.431
--- decl2.c	2001/01/26 08:27:53
*************** comdat_linkage (decl)
*** 2397,2410 ****
  {
    if (flag_weak)
      make_decl_one_only (decl);
!   else if (TREE_CODE (decl) == FUNCTION_DECL || DECL_VIRTUAL_P (decl))
!     /* We can just emit functions and vtables statically; having
!        multiple copies is (for the most part) only a waste of space.
!        There is at least one correctness issue, however: the address
!        of a template instantiation with external linkage should be the
         same, independent of what translation unit asks for the
         address, and this will not hold when we emit multiple copies of
!        the function.  However, there's little else we can do.  */
      TREE_PUBLIC (decl) = 0;
    else
      {
--- 2397,2420 ----
  {
    if (flag_weak)
      make_decl_one_only (decl);
!   else if (TREE_CODE (decl) == FUNCTION_DECL 
! 	   || (TREE_CODE (decl) == VAR_DECL && DECL_ARTIFICIAL (decl)))
!     /* We can just emit function and compiler-generated variables
!        statically; having multiple copies is (for the most part) only
!        a waste of space.  
! 
!        There are two correctness issues, however: the address of a
!        template instantiation with external linkage should be the
         same, independent of what translation unit asks for the
         address, and this will not hold when we emit multiple copies of
!        the function.  However, there's little else we can do.  
! 
!        Also, by default, the typeinfo implementation for the new ABI
!        assumes that there will be only one copy of the string used as
!        the name for each type.  Therefore, if weak symbols are
!        unavailable, the run-time library should perform a more
!        conservative check; it should perform a string comparison,
!        rather than an address comparison.  */
      TREE_PUBLIC (decl) = 0;
    else
      {
Index: gcc/cp/rtti.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/rtti.c,v
retrieving revision 1.105
diff -c -p -r1.105 rtti.c
*** rtti.c	2001/01/03 00:24:04	1.105
--- rtti.c	2001/01/26 08:27:53
*************** static tree dfs_class_hint_unmark PARAMS
*** 69,78 ****
  static int class_hint_flags PARAMS((tree));
  static tree class_initializer PARAMS((tree, tree, tree));
  static tree synthesize_tinfo_var PARAMS((tree, tree));
! static tree create_real_tinfo_var PARAMS((tree, tree, tree, int));
  static tree create_pseudo_type_info PARAMS((const char *, int, ...));
  static tree get_vmi_pseudo_type_info PARAMS((int));
  static void create_tinfo_types PARAMS((void));
  
  static int doing_runtime = 0;
  
--- 69,79 ----
  static int class_hint_flags PARAMS((tree));
  static tree class_initializer PARAMS((tree, tree, tree));
  static tree synthesize_tinfo_var PARAMS((tree, tree));
! static tree create_real_tinfo_var PARAMS((tree, tree, tree, tree, int));
  static tree create_pseudo_type_info PARAMS((const char *, int, ...));
  static tree get_vmi_pseudo_type_info PARAMS((int));
  static void create_tinfo_types PARAMS((void));
+ static int typeinfo_in_lib_p PARAMS((tree));
  
  static int doing_runtime = 0;
  
*************** tinfo_name (type)
*** 395,401 ****
     returned decl, to save the decl.  To use the decl call
     tinfo_from_decl.  You must arrange that the decl is mark_used, if
     actually use it --- decls in vtables are only used if the vtable is
!    output.  */
  
  tree
  get_tinfo_decl (type)
--- 396,402 ----
     returned decl, to save the decl.  To use the decl call
     tinfo_from_decl.  You must arrange that the decl is mark_used, if
     actually use it --- decls in vtables are only used if the vtable is
!    output.  */ 
  
  tree
  get_tinfo_decl (type)
*************** get_tinfo_decl (type)
*** 444,450 ****
        TREE_STATIC (d) = 1;
        DECL_EXTERNAL (d) = 1;
        TREE_PUBLIC (d) = 1;
!       comdat_linkage (d);
        DECL_ASSEMBLER_NAME (d) = DECL_NAME (d);
        cp_finish_decl (d, NULL_TREE, NULL_TREE, 0);
  
--- 445,452 ----
        TREE_STATIC (d) = 1;
        DECL_EXTERNAL (d) = 1;
        TREE_PUBLIC (d) = 1;
!       if (flag_weak || !typeinfo_in_lib_p (d))
! 	comdat_linkage (d);
        DECL_ASSEMBLER_NAME (d) = DECL_NAME (d);
        cp_finish_decl (d, NULL_TREE, NULL_TREE, 0);
  
*************** tinfo_base_init (desc, target)
*** 1328,1334 ****
      tree name_string = tinfo_name (target);
  
      if (flag_new_abi)
!       name_name = mangle_typeinfo_for_type (target);
      else
        name_name = build_overload_with_type (tinfo_var_id, target);
      name_decl = build_lang_decl (VAR_DECL, name_name, name_type);
--- 1330,1336 ----
      tree name_string = tinfo_name (target);
  
      if (flag_new_abi)
!       name_name = mangle_typeinfo_string_for_type (target);
      else
        name_name = build_overload_with_type (tinfo_var_id, target);
      name_decl = build_lang_decl (VAR_DECL, name_name, name_type);
*************** tinfo_base_init (desc, target)
*** 1348,1353 ****
--- 1350,1356 ----
        DECL_ASSEMBLER_NAME (name_decl) = DECL_NAME (name_decl);
      DECL_INITIAL (name_decl) = name_string;
      cp_finish_decl (name_decl, name_string, NULL_TREE, 0);
+     pushdecl_top_level (name_decl);
    }
    
    if (TINFO_VTABLE_DECL (desc))
*************** class_initializer (desc, target, trail)
*** 1539,1544 ****
--- 1542,1575 ----
    return init;  
  }
  
+ /* Returns non-zero if the typeinfo for type should be placed in 
+    the runtime library.  */
+ 
+ static int
+ typeinfo_in_lib_p (type)
+      tree type;
+ {
+   switch (TREE_CODE (type))
+     {
+     case POINTER_TYPE:
+       if ((CP_TYPE_QUALS (TREE_TYPE (type)) == TYPE_QUAL_CONST
+ 	   || CP_TYPE_QUALS (TREE_TYPE (type)) == TYPE_UNQUALIFIED)
+ 	  && typeinfo_in_lib_p (TYPE_MAIN_VARIANT (TREE_TYPE (type))))
+ 	return 1;
+       return 0;
+ 
+     case INTEGER_TYPE:
+     case BOOLEAN_TYPE:
+     case CHAR_TYPE:
+     case REAL_TYPE:
+     case VOID_TYPE:
+       return 1;
+     
+     default:
+       return 0;
+     }
+ }
+ 
  /* Generate a pseudo_type_info VAR_DECL suitable for the supplied
     TARGET_TYPE and given the REAL_NAME. This is the structure expected by
     the runtime, and therefore has additional fields.  If we need not emit a
*************** synthesize_tinfo_var (target_type, real_
*** 1566,1579 ****
          }
        else
          {
!           int code = TREE_CODE (TREE_TYPE (target_type));
!           
!           if ((CP_TYPE_QUALS (TREE_TYPE (target_type)) | TYPE_QUAL_CONST)
!               == TYPE_QUAL_CONST
!               && (code == INTEGER_TYPE || code == BOOLEAN_TYPE
!                   || code == CHAR_TYPE || code == REAL_TYPE
!                   || code == VOID_TYPE)
!               && !doing_runtime)
              /* These are in the runtime.  */
              return NULL_TREE;
            var_type = ptr_desc_type_node;
--- 1597,1603 ----
          }
        else
          {
!           if (typeinfo_in_lib_p (target_type) && !doing_runtime)
              /* These are in the runtime.  */
              return NULL_TREE;
            var_type = ptr_desc_type_node;
*************** synthesize_tinfo_var (target_type, real_
*** 1675,1698 ****
              }
            var_init = class_initializer (var_type, target_type, base_inits);
          }
-       break;
-     case INTEGER_TYPE:
-     case BOOLEAN_TYPE:
-     case CHAR_TYPE:
-     case REAL_TYPE:
-     case VOID_TYPE:
-       if (!doing_runtime)
-         /* These are guaranteed to be in the runtime.  */
-         return NULL_TREE;
-       var_type = bltn_desc_type_node;
-       var_init = generic_initializer (var_type, target_type);
        break;
      default:
        my_friendly_abort (20000117);
      }
    
    
!   return create_real_tinfo_var (real_name, TINFO_PSEUDO_TYPE (var_type),
                                  var_init, non_public);
  }
  
--- 1699,1722 ----
              }
            var_init = class_initializer (var_type, target_type, base_inits);
          }
        break;
+ 
      default:
+       if (typeinfo_in_lib_p (target_type))
+ 	{
+ 	  if (!doing_runtime)
+ 	    /* These are guaranteed to be in the runtime.  */
+ 	    return NULL_TREE;
+ 	  var_type = bltn_desc_type_node;
+ 	  var_init = generic_initializer (var_type, target_type);
+ 	  break;
+ 	}
        my_friendly_abort (20000117);
      }
    
    
!   return create_real_tinfo_var (target_type,
! 				real_name, TINFO_PSEUDO_TYPE (var_type),
                                  var_init, non_public);
  }
  
*************** synthesize_tinfo_var (target_type, real_
*** 1700,1706 ****
     make this variable public (comdat). */
  
  static tree
! create_real_tinfo_var (name, type, init, non_public)
       tree name;
       tree type;
       tree init;
--- 1724,1731 ----
     make this variable public (comdat). */
  
  static tree
! create_real_tinfo_var (target_type, name, type, init, non_public)
!      tree target_type;
       tree name;
       tree type;
       tree init;
*************** create_real_tinfo_var (name, type, init,
*** 1726,1732 ****
    if (!non_public)
      {
        TREE_PUBLIC (decl) = 1;
!       comdat_linkage (decl);
      }
    DECL_ASSEMBLER_NAME (decl) = name;
    DECL_INITIAL (decl) = init;
--- 1751,1758 ----
    if (!non_public)
      {
        TREE_PUBLIC (decl) = 1;
!       if (flag_weak || !typeinfo_in_lib_p (target_type))
! 	comdat_linkage (decl);
      }
    DECL_ASSEMBLER_NAME (decl) = name;
    DECL_INITIAL (decl) = init;
Index: libstdc++-v3/libsupc++/tinfo.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libsupc++/tinfo.cc,v
retrieving revision 1.2
diff -c -p -r1.2 tinfo.cc
*** tinfo.cc	2000/10/21 16:50:29	1.2
--- tinfo.cc	2001/01/26 08:28:27
*************** std::type_info::
*** 41,46 ****
--- 42,58 ----
  ~type_info ()
  { }
  
+ #if !__GXX_MERGED_TYPEINFO_NAMES
+ 
+ // We can't rely on common symbols being shared between shared objects.
+ bool std::type_info::
+ operator== (const std::type_info& arg) const
+ {
+   return (&arg == this) || (__builtin_strcmp (name (), arg.name ()) == 0);
+ }
+ 
+ #endif
+ 
  #if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
  // original (old) abi
  
*************** convert_to_base (void *addr, bool is_vir
*** 62,74 ****
    return *((void **) ((char *) addr + offset));
  }
  
- }
- 
- // We can't rely on common symbols being shared between shared objects.
- bool std::type_info::
- operator== (const std::type_info& arg) const
- {
-   return (&arg == this) || (__builtin_strcmp (name (), arg.name ()) == 0);
  }
  
  extern "C" void
--- 74,79 ----
Index: libstdc++-v3/libsupc++/tinfo2.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libsupc++/tinfo2.cc,v
retrieving revision 1.2
diff -c -p -r1.2 tinfo2.cc
*** tinfo2.cc	2000/10/31 01:26:06	1.2
--- tinfo2.cc	2001/01/26 08:28:28
*************** extern "C" void abort ();
*** 36,47 ****
  
  using std::type_info;
  
! #if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
  bool
  type_info::before (const type_info &arg) const
  {
    return __builtin_strcmp (name (), arg.name ()) < 0;
  }
  
  // type info for pointer type.
  
--- 36,52 ----
  
  using std::type_info;
  
! #if !__GXX_MERGED_TYPEINFO_NAMES
! 
  bool
  type_info::before (const type_info &arg) const
  {
    return __builtin_strcmp (name (), arg.name ()) < 0;
  }
+ 
+ #endif
+ 
+ #if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
  
  // type info for pointer type.
  
Index: libstdc++-v3/libsupc++/typeinfo
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/libsupc++/typeinfo,v
retrieving revision 1.2
diff -c -p -r1.2 typeinfo
*** typeinfo	2001/01/17 07:44:56	1.2
--- typeinfo	2001/01/26 08:28:28
*************** namespace __cxxabiv1
*** 48,53 ****
--- 48,66 ----
  } // namespace __cxxabiv1
  #endif
  
+ 
+ #if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
+   // In the old ABI, typeinfo name strings were not merged.
+   #define __GXX_MERGED_TYPEINFO_NAMES 0
+ #elif !__GXX_WEAK__
+   // If weak symbols are not supported, they are still not merged.
+   #define __GXX_MERGED_TYPEINFO_NAMES 0
+ #else
+   // In the new ABI, on platforms that support weak symbols, they are
+   // merged.
+   #define __GXX_MERGED_TYPEINFO_NAMES 1
+ #endif
+ 
  namespace std 
  {
    class type_info 
*************** namespace std 
*** 73,100 ****
    public:
      // the public interface
  #if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
-     // In old abi, there can be multiple instances of a type_info
-     // object for one type. Uniqueness must use the _name value, not
-     // object address.
-     bool before(const type_info& arg) const;
      const char* name() const
      { return __name; }
!     bool operator==(const type_info& __arg) const;
!     bool operator!=(const type_info& __arg) const
!     { return !operator==(__arg); }
  
  #else
      // In new abi we can rely on type_info's NTBS being unique,
      // and therefore address comparisons are sufficient.
      bool before(const type_info& __arg) const
      { return __name < __arg.__name; }
-     const char* name() const
-     { return __name; }
      bool operator==(const type_info& __arg) const
      { return __name == __arg.__name; }
      bool operator!=(const type_info& __arg) const
      { return !operator==(__arg); }
- #endif
      
      // the internal interface
  #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100
--- 86,114 ----
    public:
      // the public interface
  #if !defined(__GXX_ABI_VERSION) || __GXX_ABI_VERSION < 100
      const char* name() const
      { return __name; }
! #else
!     const char* name() const
!     { return __name; }
! #endif
  
+ #if !__GXX_MERGED_TYPEINFO_NAMES
+     bool before(const type_info& arg) const;
+     // In old abi, or when weak symbols are not supported, there can
+     // be multiple instances of a type_info object for one
+     // type. Uniqueness must use the _name value, not object address.
+     bool operator==(const type_info& __arg) const;
  #else
      // In new abi we can rely on type_info's NTBS being unique,
      // and therefore address comparisons are sufficient.
      bool before(const type_info& __arg) const
      { return __name < __arg.__name; }
      bool operator==(const type_info& __arg) const
      { return __name == __arg.__name; }
+ #endif
      bool operator!=(const type_info& __arg) const
      { return !operator==(__arg); }
      
      // the internal interface
  #if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]