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]

[C++ PATCH]: kill new-abi reference type info


Hi,
Now the new abi spec is settling down again, I've started to implement
those changes. I've installed the attached which removes the unrequired
reference type info structure.

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2000-03-15  Nathan Sidwell  <nathan@codesourcery.com>

	* cp-tree.h (CPTI_REF_DESC_TYPE, ref_desc_type_node): Remove.
	* decl.c (ref_desc_type_node): Undocument.
	* rtti.c (ptr_ref_initializer): Rename to ...
	(ptr_initializer): ... here. Adjust comments.
	(ptmd_initializer): Fix comment thinko.
	(synthesize_tinfo_var): Remove REFERENCE_TYPE case.
	(create_tinfo_types): Remove ref_desc_type_node init.
	* tinfo2.cc (__reference_type_info): Remove.

Index: cp/cp-tree.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/cp-tree.h,v
retrieving revision 1.418
diff -c -3 -p -r1.418 cp-tree.h
*** cp-tree.h	2000/03/15 00:46:47	1.418
--- cp-tree.h	2000/03/15 09:56:23
*************** enum cp_tree_index
*** 520,526 ****
      CPTI_TI_DESC_TYPE,
      CPTI_BLTN_DESC_TYPE,
      CPTI_PTR_DESC_TYPE,
-     CPTI_REF_DESC_TYPE,
      CPTI_ARY_DESC_TYPE,
      CPTI_FUNC_DESC_TYPE,
      CPTI_ENUM_DESC_TYPE,
--- 520,525 ----
*************** extern tree cp_global_trees[CPTI_MAX];
*** 606,612 ****
  #define ti_desc_type_node		cp_global_trees[CPTI_TI_DESC_TYPE]
  #define bltn_desc_type_node		cp_global_trees[CPTI_BLTN_DESC_TYPE]
  #define ptr_desc_type_node		cp_global_trees[CPTI_PTR_DESC_TYPE]
- #define ref_desc_type_node		cp_global_trees[CPTI_REF_DESC_TYPE]
  #define ary_desc_type_node		cp_global_trees[CPTI_ARY_DESC_TYPE]
  #define func_desc_type_node		cp_global_trees[CPTI_FUNC_DESC_TYPE]
  #define enum_desc_type_node		cp_global_trees[CPTI_ENUM_DESC_TYPE]
--- 605,610 ----
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.569
diff -c -3 -p -r1.569 decl.c
*** decl.c	2000/03/15 09:45:39	1.569
--- decl.c	2000/03/15 09:56:25
*************** tree error_mark_list;
*** 211,217 ****
  	tree __tp_desc_type_node;
  #endif
          tree ti_desc_type_node;
! 	tree bltn_desc_type_node, ptr_desc_type_node, ref_desc_type_node;
  	tree ary_desc_type_node, func_desc_type_node, enum_desc_type_node;
  	tree class_desc_type_node, si_class_desc_type_node, vmi_class_desc_type_node;
  	tree ptmd_desc_type_node;
--- 211,217 ----
  	tree __tp_desc_type_node;
  #endif
          tree ti_desc_type_node;
! 	tree bltn_desc_type_node, ptr_desc_type_node;
  	tree ary_desc_type_node, func_desc_type_node, enum_desc_type_node;
  	tree class_desc_type_node, si_class_desc_type_node, vmi_class_desc_type_node;
  	tree ptmd_desc_type_node;
Index: cp/rtti.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/rtti.c,v
retrieving revision 1.67
diff -c -3 -p -r1.67 rtti.c
*** rtti.c	2000/03/11 10:14:13	1.67
--- rtti.c	2000/03/15 09:56:26
*************** static tree tinfo_from_decl PARAMS((tree
*** 64,70 ****
  static int qualifier_flags PARAMS((tree));
  static tree tinfo_base_init PARAMS((tree, tree));
  static tree generic_initializer PARAMS((tree, tree));
! static tree ptr_ref_initializer PARAMS((tree, tree));
  static tree ptmd_initializer PARAMS((tree, tree));
  static int class_hint_flags PARAMS((tree));
  static tree class_initializer PARAMS((tree, tree, tree));
--- 64,70 ----
  static int qualifier_flags PARAMS((tree));
  static tree tinfo_base_init PARAMS((tree, tree));
  static tree generic_initializer PARAMS((tree, tree));
! static tree ptr_initializer PARAMS((tree, tree));
  static tree ptmd_initializer PARAMS((tree, tree));
  static int class_hint_flags PARAMS((tree));
  static tree class_initializer PARAMS((tree, tree, tree));
*************** generic_initializer (desc, target)
*** 1298,1309 ****
    return init;
  }
  
! /* Return the CONSTRUCTOR expr for a type_info of pointer or reference TYPE.
     DESC provides information about the particular type_info derivation,
     which adds target type and qualifier flags members to the type_info base.  */
  
  static tree
! ptr_ref_initializer (desc, target)
       tree desc;
       tree target;
  {
--- 1298,1309 ----
    return init;
  }
  
! /* Return the CONSTRUCTOR expr for a type_info of pointer TYPE.
     DESC provides information about the particular type_info derivation,
     which adds target type and qualifier flags members to the type_info base.  */
  
  static tree
! ptr_initializer (desc, target)
       tree desc;
       tree target;
  {
*************** ptr_ref_initializer (desc, target)
*** 1322,1328 ****
    return init;
  }
  
! /* Return the CONSTRUCTOR expr for a type_info of pointer or reference TYPE.
     DESC provides information about the particular type_info derivation,
     which adds target type and qualifier flags members to the type_info base.  */
  
--- 1322,1328 ----
    return init;
  }
  
! /* Return the CONSTRUCTOR expr for a type_info of pointer to member data TYPE.
     DESC provides information about the particular type_info derivation,
     which adds target type and qualifier flags members to the type_info base.  */
  
*************** synthesize_tinfo_var (target_type, real_
*** 1427,1439 ****
              /* These are in the runtime.  */
              return NULL_TREE;
            var_type = ptr_desc_type_node;
!           var_init = ptr_ref_initializer (var_type, target_type);
          }
        break;
-     case REFERENCE_TYPE:
-       var_type = ref_desc_type_node;
-       var_init = ptr_ref_initializer (var_type, target_type);
-       break;
      case ENUMERAL_TYPE:
        var_type = enum_desc_type_node;
        var_init = generic_initializer (var_type, target_type);
--- 1427,1435 ----
              /* These are in the runtime.  */
              return NULL_TREE;
            var_type = ptr_desc_type_node;
!           var_init = ptr_initializer (var_type, target_type);
          }
        break;
      case ENUMERAL_TYPE:
        var_type = enum_desc_type_node;
        var_init = generic_initializer (var_type, target_type);
*************** create_tinfo_types ()
*** 1704,1718 ****
        ("__fundamental_type_info", 0,
         NULL);
  
!   /* Pointer and reference type_info. These two fields, qualification mask
!       and pointer to the pointed to (referenced) type.  */
    ptr_desc_type_node = create_pseudo_type_info
        ("__pointer_type_info", 0,
-        build_lang_decl (FIELD_DECL, NULL_TREE, integer_type_node),
-        build_lang_decl (FIELD_DECL, NULL_TREE, ptr_type_info),
-        NULL);
-   ref_desc_type_node = create_pseudo_type_info
-       ("__reference_type_info", 0,
         build_lang_decl (FIELD_DECL, NULL_TREE, integer_type_node),
         build_lang_decl (FIELD_DECL, NULL_TREE, ptr_type_info),
         NULL);
--- 1700,1709 ----
        ("__fundamental_type_info", 0,
         NULL);
  
!   /* Pointer type_info. Adds two fields, qualification mask
!      and pointer to the pointed to type.  */
    ptr_desc_type_node = create_pseudo_type_info
        ("__pointer_type_info", 0,
         build_lang_decl (FIELD_DECL, NULL_TREE, integer_type_node),
         build_lang_decl (FIELD_DECL, NULL_TREE, ptr_type_info),
         NULL);
Index: cp/tinfo2.cc
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/tinfo2.cc,v
retrieving revision 1.15
diff -c -3 -p -r1.15 tinfo2.cc
*** tinfo2.cc	2000/02/26 20:15:46	1.15
--- tinfo2.cc	2000/03/15 09:56:26
*************** protected:
*** 130,156 ****
                           unsigned outer) const;
  };
  
- // type information for reference to data
- class __reference_type_info : public type_info {
- public:
-   virtual ~__reference_type_info ();
-   int quals;                // qualification of the target object
-   const type_info *target;  // type of object being referenced
- 
- // internal parts
-   enum quals_masks {
-     const_mask = 0x1,
-     volatile_mask = 0x2
-   };
-   
- public:
-   explicit __reference_type_info (const char *n,
-                                   int quals_,
-                                   const type_info *target_)
-     : type_info (n), quals (quals_), target (target_)
-     { }
- };
- 
  // type information for array objects
  class __array_type_info : public type_info {
  public:
--- 130,135 ----
*************** __fundamental_type_info::
*** 227,236 ****
  
  __pointer_type_info::
  ~__pointer_type_info ()
- {}
- 
- __reference_type_info::
- ~__reference_type_info ()
  {}
  
  __array_type_info::
--- 206,211 ----

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