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++) remove cruft


I went to add something to lang_type and discovered several things that
didn't look like they belonged there anymore.  So I went on a killing
spree.

1999-03-30  Jason Merrill  <jason@yorick.cygnus.com>

	* cp-tree.h (IDENTIFIER_AS_DESC, IDENTIFIER_AS_LIST, 
	CLASSTYPE_BASELINK_VEC, CLASSTYPE_N_SUPERCLASSES, 
	CLASSTYPE_N_BASECLASSES, CLASSTYPE_MAX_DEPTH, 
	CLASSTYPE_BASE_INIT_LIST, CLASSTYPE_AS_LIST, CLASSTYPE_ID_AS_LIST,
	CLASSTYPE_BINFO_AS_LIST): Remove cruft.
	* class.c, lex.c, parse.y, ptree.c, search.c, semantics.c, 
	tree.c: Adjust.

Index: class.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/class.c,v
retrieving revision 1.138
diff -c -p -r1.138 class.c
*** class.c	1999/03/26 07:44:17	1.138
--- class.c	1999/03/31 07:22:45
*************** add_method (type, fields, method)
*** 1295,1312 ****
        /* Actually insert the new method.  */
        TREE_VEC_ELT (method_vec, slot) 
  	= build_overload (method, TREE_VEC_ELT (method_vec, slot));
- 
-       if (TYPE_BINFO_BASETYPES (type) && CLASSTYPE_BASELINK_VEC (type))
- 	{
- 	  /* ??? May be better to know whether these can be extended?  */
- 	  tree baselink_vec = CLASSTYPE_BASELINK_VEC (type);
- 	  
- 	  TREE_VEC_LENGTH (baselink_vec) += 1;
- 	  CLASSTYPE_BASELINK_VEC (type) = copy_node (baselink_vec);
- 	  TREE_VEC_LENGTH (baselink_vec) -= 1;
- 	  
- 	  TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), len) = 0;
- 	}
      }
    pop_obstacks ();
  }
--- 1295,1300 ----
*************** build_class_init_list (type)
*** 1641,1650 ****
  	  continue;
  	}
  
-       if ((blist = CLASSTYPE_BASE_INIT_LIST (BINFO_TYPE (base_binfo))) == NULL_TREE)
- 	/* Nothing to initialize.  */
- 	continue;
- 
        /* ...ditto...  */
        base_init_list = maybe_fixup_vptrs (type, base_binfo, base_init_list);
  
--- 1629,1634 ----
*************** build_class_init_list (type)
*** 1687,1716 ****
  	  /* The function expand_aggr_init knows how to do the
  	     initialization of `basetype' without getting
  	     an explicit `blist'.  */
! 	  if (base_init_list)
! 	    base_init_list = tree_cons (NULL_TREE, base_binfo, base_init_list);
! 	  else
! 	    base_init_list = CLASSTYPE_BINFO_AS_LIST (BINFO_TYPE (base_binfo));
  	}
      }
- 
-   if (base_init_list)
-     {
-       if (member_init_list)
- 	CLASSTYPE_BASE_INIT_LIST (type) =
- 	  build_tree_list (base_init_list, member_init_list);
-       else
- 	CLASSTYPE_BASE_INIT_LIST (type) = base_init_list;
-     }
-   else if (member_init_list)
-     CLASSTYPE_BASE_INIT_LIST (type) = member_init_list;
  }
  
  struct base_info
  {
    int has_virtual;
    int max_has_virtual;
-   int n_ancestors;
    tree vfield;
    tree vfields;
    tree rtti;
--- 1671,1685 ----
  	  /* The function expand_aggr_init knows how to do the
  	     initialization of `basetype' without getting
  	     an explicit `blist'.  */
! 	  base_init_list = tree_cons (NULL_TREE, base_binfo, base_init_list);
  	}
      }
  }
  
  struct base_info
  {
    int has_virtual;
    int max_has_virtual;
    tree vfield;
    tree vfields;
    tree rtti;
*************** finish_base_struct (t, b)
*** 1793,1799 ****
  	  && !TYPE_HAS_CONST_ASSIGN_REF (basetype))
  	b->no_const_asn_ref = 1;
  
-       b->n_ancestors += CLASSTYPE_N_SUPERCLASSES (basetype);
        TYPE_NEEDS_CONSTRUCTING (t) |= TYPE_NEEDS_CONSTRUCTING (basetype);
        TYPE_NEEDS_DESTRUCTOR (t) |= TYPE_NEEDS_DESTRUCTOR (basetype);
        TYPE_HAS_COMPLEX_ASSIGN_REF (t) |= TYPE_HAS_COMPLEX_ASSIGN_REF (basetype);
--- 1762,1767 ----
*************** finish_base_struct (t, b)
*** 1803,1811 ****
        TYPE_OVERLOADS_ARRAY_REF (t) |= TYPE_OVERLOADS_ARRAY_REF (basetype);
        TYPE_OVERLOADS_ARROW (t) |= TYPE_OVERLOADS_ARROW (basetype);
  
-       if (! TREE_VIA_VIRTUAL (base_binfo))
- 	CLASSTYPE_N_SUPERCLASSES (t) += 1;
- 
        if (TYPE_VIRTUAL_P (basetype))
  	{
  	  /* Ensure that this is set from at least a virtual base
--- 1771,1776 ----
*************** finish_struct_bits (t, max_has_virtual)
*** 1960,1973 ****
  
    if (n_baseclasses && max_has_virtual)
      {
!       /* for a class w/o baseclasses, `finish_struct' has set
!        * CLASS_TYPE_ABSTRACT_VIRTUALS correctly (by definition). Similarly
!        * for a class who's base classes do not have vtables. When neither of
!        * these is true, we might have removed abstract virtuals (by
!        * providing a definition), added some (by declaring new ones), or
!        * redeclared ones from a base class. We need to recalculate what's
!        * really an abstract virtual at this point (by looking in the vtables).
!        */
        CLASSTYPE_ABSTRACT_VIRTUALS (t) = get_abstract_virtuals (t);
      }
  
--- 1925,1938 ----
  
    if (n_baseclasses && max_has_virtual)
      {
!       /* For a class w/o baseclasses, `finish_struct' has set
!          CLASS_TYPE_ABSTRACT_VIRTUALS correctly (by definition). Similarly
!          for a class who's base classes do not have vtables. When neither
!          of these is true, we might have removed abstract virtuals (by
!          providing a definition), added some (by declaring new ones), or
!          redeclared ones from a base class. We need to recalculate what's
!          really an abstract virtual at this point (by looking in the
!          vtables).  */
        CLASSTYPE_ABSTRACT_VIRTUALS (t) = get_abstract_virtuals (t);
      }
  
*************** finish_struct_bits (t, max_has_virtual)
*** 1983,1990 ****
  	  basetype = BINFO_TYPE (TREE_VEC_ELT (binfos, i));
  
  	  TYPE_HAS_CONVERSION (t) |= TYPE_HAS_CONVERSION (basetype);
- 	  if (CLASSTYPE_MAX_DEPTH (basetype) >= CLASSTYPE_MAX_DEPTH (t))
- 	    CLASSTYPE_MAX_DEPTH (t) = CLASSTYPE_MAX_DEPTH (basetype) + 1;
  	}
      }
  
--- 1948,1953 ----
*************** finish_struct_methods (t)
*** 2185,2191 ****
    tree fn_fields;
    tree method_vec = CLASSTYPE_METHOD_VEC (t);
    tree ctor_name = constructor_name (t);
-   int i, n_baseclasses = CLASSTYPE_N_BASECLASSES (t);
  
    /* First fill in entry 0 with the constructors, entry 1 with destructors,
       and the next few with type conversion operators (if any).  */
--- 2148,2153 ----
*************** finish_struct_methods (t)
*** 2244,2277 ****
    /* Issue warnings about private constructors and such.  If there are
       no methods, then some public defaults are generated.  */
    maybe_warn_about_overly_private_class (t); 
- 
-   /* Now for each member function (except for constructors and
-      destructors), compute where member functions of the same
-      name reside in base classes.  */
-   if (n_baseclasses != 0
-       && method_vec
-       && TREE_VEC_LENGTH (method_vec) > 2)
-     {
-       int len = TREE_VEC_LENGTH (method_vec);
-       tree baselink_vec = make_tree_vec (len);
-       int any_links = 0;
-       tree baselink_binfo = build_tree_list (NULL_TREE, TYPE_BINFO (t));
- 
-       for (i = 2; i < len && TREE_VEC_ELT (method_vec, i); i++)
- 	{
- 	  tree ovl = TREE_VEC_ELT (method_vec, i);
- 
- 	  TREE_VEC_ELT (baselink_vec, i)
- 	    = get_baselinks (baselink_binfo, t, 
- 			     DECL_NAME (OVL_CURRENT (ovl)));
- 	  if (TREE_VEC_ELT (baselink_vec, i) != 0)
- 	    any_links = 1;
- 	}
-       if (any_links != 0)
- 	CLASSTYPE_BASELINK_VEC (t) = baselink_vec;
-       else
- 	obstack_free (current_obstack, baselink_vec);
-     }
  }
  
  /* Emit error when a duplicate definition of a type is seen.  Patch up.  */
--- 2206,2211 ----
*************** duplicate_tag_error (t)
*** 2310,2327 ****
  
    if (TYPE_LANG_SPECIFIC (t))
      {
-       tree as_list = CLASSTYPE_AS_LIST (t);
        tree binfo = TYPE_BINFO (t);
-       tree binfo_as_list = CLASSTYPE_BINFO_AS_LIST (t);
        int interface_only = CLASSTYPE_INTERFACE_ONLY (t);
        int interface_unknown = CLASSTYPE_INTERFACE_UNKNOWN (t);
  
        bzero ((char *) TYPE_LANG_SPECIFIC (t), sizeof (struct lang_type));
        BINFO_BASETYPES(binfo) = NULL_TREE;
  
-       CLASSTYPE_AS_LIST (t) = as_list;
        TYPE_BINFO (t) = binfo;
-       CLASSTYPE_BINFO_AS_LIST (t) = binfo_as_list;
        CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
        SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown);
        TYPE_REDEFINED (t) = 1;
--- 2244,2257 ----
*************** finish_struct_1 (t, warn_anon)
*** 3370,3376 ****
        CLASSTYPE_VFIELD_PARENT (t) = first_vfn_base_index;
        has_virtual = base_info.has_virtual;
        max_has_virtual = base_info.max_has_virtual;
-       CLASSTYPE_N_SUPERCLASSES (t) += base_info.n_ancestors;
        vfield = base_info.vfield;
        vfields = base_info.vfields;
        CLASSTYPE_RTTI (t) = base_info.rtti;
--- 3300,3305 ----
*************** finish_struct_1 (t, warn_anon)
*** 3899,3905 ****
  	fields = vfield;
  #endif
        empty = 0;
!       vfields = chainon (vfields, CLASSTYPE_AS_LIST (t));
      }
  
    /* Now DECL_INITIAL is null on all members except for zero-width bit-fields.
--- 3828,3834 ----
  	fields = vfield;
  #endif
        empty = 0;
!       vfields = chainon (vfields, build_tree_list (NULL_TREE, t));
      }
  
    /* Now DECL_INITIAL is null on all members except for zero-width bit-fields.
*************** finish_struct_1 (t, warn_anon)
*** 4014,4020 ****
        tree vbases;
  
        vbases = CLASSTYPE_VBASECLASSES (t);
-       CLASSTYPE_N_VBASECLASSES (t) = list_length (vbases);
  
        {
  	/* Now fixup overrides of all functions in vtables from all
--- 3943,3948 ----
Index: cp-tree.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/cp-tree.h,v
retrieving revision 1.210
diff -c -p -r1.210 cp-tree.h
*** cp-tree.h	1999/03/27 17:33:31	1.210
--- cp-tree.h	1999/03/31 07:22:45
*************** struct lang_identifier
*** 104,110 ****
  struct lang_id2
  {
    tree label_value, implicit_decl;
!   tree type_desc, as_list, error_locus;
  };
  
  typedef struct 
--- 104,110 ----
  struct lang_id2
  {
    tree label_value, implicit_decl;
!   tree error_locus;
  };
  
  typedef struct 
*************** struct tree_srcloc
*** 278,291 ****
  #define SET_IDENTIFIER_IMPLICIT_DECL(NODE,VALUE) \
  	SET_LANG_ID(NODE, VALUE, implicit_decl)
  
- #define IDENTIFIER_AS_DESC(NODE)	    LANG_ID_FIELD(type_desc, NODE)
- #define SET_IDENTIFIER_AS_DESC(NODE,DESC)	\
- 	SET_LANG_ID(NODE, DESC, type_desc)
- 
- #define IDENTIFIER_AS_LIST(NODE)	    LANG_ID_FIELD(as_list, NODE)
- #define SET_IDENTIFIER_AS_LIST(NODE,LIST)	\
- 	SET_LANG_ID(NODE, LIST, as_list)
- 
  #define IDENTIFIER_ERROR_LOCUS(NODE)	    LANG_ID_FIELD(error_locus, NODE)
  #define SET_IDENTIFIER_ERROR_LOCUS(NODE,VALUE)	\
  	SET_LANG_ID(NODE, VALUE, error_locus)
--- 278,283 ----
*************** struct lang_type
*** 737,749 ****
        unsigned dummy : 11;
      } type_flags;
  
-   int n_ancestors;
-   int n_vancestors;
    int vsize;
-   int max_depth;
    int vfield_parent;
  
-   union tree_node *baselink_vec;
    union tree_node *vfields;
    union tree_node *vbases;
  
--- 729,737 ----
*************** struct lang_type
*** 756,766 ****
  
    union tree_node *size;
  
-   union tree_node *base_init_list;
    union tree_node *abstract_virtuals;
-   union tree_node *as_list;
-   union tree_node *id_as_list;
-   union tree_node *binfo_as_list;
    union tree_node *friend_classes;
  
    union tree_node *rtti;
--- 744,750 ----
*************** struct lang_type
*** 862,868 ****
     signature reference type.  */
  #define SIGNATURE_REFERENCE_TO(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature_reference_to)
  
! /* The is the VAR_DECL that contains NODE's rtti.  */
  #define CLASSTYPE_RTTI(NODE) (TYPE_LANG_SPECIFIC(NODE)->rtti)
  
  /* Nonzero means that this _CLASSTYPE node overloads operator().  */
--- 846,852 ----
     signature reference type.  */
  #define SIGNATURE_REFERENCE_TO(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature_reference_to)
  
! /* The is the basetype that contains NODE's rtti.  */
  #define CLASSTYPE_RTTI(NODE) (TYPE_LANG_SPECIFIC(NODE)->rtti)
  
  /* Nonzero means that this _CLASSTYPE node overloads operator().  */
*************** struct lang_type
*** 900,909 ****
      ? TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), 2) \
      : NULL_TREE;
  
- /* Pointer from any member function to the head of the list of
-    member functions of the type that member function belongs to.  */
- #define CLASSTYPE_BASELINK_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->baselink_vec)
- 
  /* Mark bits for depth-first and breath-first searches.  */
  
  /* Get the value of the Nth mark bit.  */
--- 884,889 ----
*************** struct lang_type
*** 974,990 ****
  #define CLASSTYPE_N_BASECLASSES(NODE) \
    (TYPE_BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES(NODE)) : 0)
  
- /* Memoize the number of super classes (base classes) that this node
-    has.  That way we can know immediately (albeit conservatively how
-    large a multiple-inheritance matrix we need to build to find
-    derivation information.  */
- #define CLASSTYPE_N_SUPERCLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->n_ancestors)
- #define CLASSTYPE_N_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->n_vancestors)
- 
- /* Record how deep the inheritance is for this class so `void*' conversions
-    are less favorable than a conversion to the most base type.  */
- #define CLASSTYPE_MAX_DEPTH(NODE) (TYPE_LANG_SPECIFIC(NODE)->max_depth)
- 
  /* Used for keeping search-specific information.  Any search routine
     which uses this must define what exactly this slot is used for.  */
  #define CLASSTYPE_SEARCH_SLOT(NODE) (TYPE_LANG_SPECIFIC(NODE)->search_slot)
--- 954,959 ----
*************** struct lang_type
*** 994,1010 ****
  #define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size)
  #define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->align)
  
- /* A cons list of structure elements which either have constructors
-    to be called, or virtual function table pointers which
-    need initializing.  Depending on what is being initialized,
-    the TREE_PURPOSE and TREE_VALUE fields have different meanings:
- 
-    Member initialization: <FIELD_DECL, TYPE>
-    Base class construction: <NULL_TREE, BASETYPE>
-    Base class initialization: <BASE_INITIALIZATION, THESE_INITIALIZATIONS>
-    Whole type: <MEMBER_INIT, BASE_INIT>.  */
- #define CLASSTYPE_BASE_INIT_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->base_init_list)
- 
  /* A cons list of virtual functions which cannot be inherited by
     derived classes.  When deriving from this type, the derived
     class must provide its own definition for each of these functions.  */
--- 963,968 ----
*************** struct lang_type
*** 1038,1053 ****
  #define CLASSTYPE_HAS_MUTABLE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_mutable)
  #define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE))
  
- /* Many routines need to cons up a list of basetypes for access
-    checking.  This field contains a TREE_LIST node whose TREE_VALUE
-    is the main variant of the type, and whose TREE_VIA_PUBLIC
-    and TREE_VIA_VIRTUAL bits are correctly set.  */
- #define CLASSTYPE_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->as_list)
- /* Same, but cache a list whose value is the name of this type.  */
- #define CLASSTYPE_ID_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->id_as_list)
- /* Same, but cache a list whose value is the binfo of this type.  */
- #define CLASSTYPE_BINFO_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->binfo_as_list)
- 
  /* A list of class types of which this type is a friend.  The
     TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the
     case of a template friend.  */
--- 996,1001 ----
*************** extern tree lookup_member			PROTO((tree,
*** 3221,3228 ****
  extern tree lookup_nested_tag			PROTO((tree, tree));
  extern tree get_matching_virtual		PROTO((tree, tree, int));
  extern tree get_abstract_virtuals		PROTO((tree));
- extern tree get_baselinks			PROTO((tree, tree, tree));
- extern tree next_baselink			PROTO((tree));
  extern tree init_vbase_pointers			PROTO((tree, tree));
  extern void expand_indirect_vtbls_init		PROTO((tree, tree, tree));
  extern void clear_search_slots			PROTO((tree));
--- 3169,3174 ----
*************** extern tree build_base_fields			PROTO((t
*** 3352,3358 ****
  extern tree hash_tree_cons			PROTO((int, int, int, tree, tree, tree));
  extern tree hash_tree_chain			PROTO((tree, tree));
  extern tree hash_chainon			PROTO((tree, tree));
- extern tree get_decl_list			PROTO((tree));
  extern tree make_binfo				PROTO((tree, tree, tree, tree));
  extern tree binfo_value				PROTO((tree, tree));
  extern tree reverse_path			PROTO((tree));
--- 3298,3303 ----
Index: lex.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/lex.c,v
retrieving revision 1.105
diff -c -p -r1.105 lex.c
*** lex.c	1999/03/26 07:44:31	1.105
--- lex.c	1999/03/31 07:22:45
*************** init_parse (filename)
*** 679,748 ****
    token_buffer = (char *) xmalloc (maxtoken + 2);
  
    ridpointers[(int) RID_INT] = get_identifier ("int");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_INT],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_INT]));
    ridpointers[(int) RID_BOOL] = get_identifier ("bool");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_BOOL],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_BOOL]));
    ridpointers[(int) RID_CHAR] = get_identifier ("char");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_CHAR],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_CHAR]));
    ridpointers[(int) RID_VOID] = get_identifier ("void");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_VOID],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_VOID]));
    ridpointers[(int) RID_FLOAT] = get_identifier ("float");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_FLOAT],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_FLOAT]));
    ridpointers[(int) RID_DOUBLE] = get_identifier ("double");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_DOUBLE],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_DOUBLE]));
    ridpointers[(int) RID_SHORT] = get_identifier ("short");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_SHORT],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_SHORT]));
    ridpointers[(int) RID_LONG] = get_identifier ("long");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_LONG],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_LONG]));
    ridpointers[(int) RID_UNSIGNED] = get_identifier ("unsigned");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_UNSIGNED],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_UNSIGNED]));
    ridpointers[(int) RID_SIGNED] = get_identifier ("signed");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_SIGNED],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_SIGNED]));
    ridpointers[(int) RID_INLINE] = get_identifier ("inline");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_INLINE],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_INLINE]));
    ridpointers[(int) RID_CONST] = get_identifier ("const");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_CONST],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_CONST]));
    ridpointers[(int) RID_VOLATILE] = get_identifier ("volatile");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_VOLATILE],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_VOLATILE]));
    ridpointers[(int) RID_RESTRICT] = get_identifier ("__restrict");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_RESTRICT],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_RESTRICT]));
    ridpointers[(int) RID_AUTO] = get_identifier ("auto");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_AUTO],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_AUTO]));
    ridpointers[(int) RID_STATIC] = get_identifier ("static");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_STATIC],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_STATIC]));
    ridpointers[(int) RID_EXTERN] = get_identifier ("extern");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_EXTERN],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_EXTERN]));
    ridpointers[(int) RID_TYPEDEF] = get_identifier ("typedef");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_TYPEDEF],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_TYPEDEF]));
    ridpointers[(int) RID_REGISTER] = get_identifier ("register");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_REGISTER],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_REGISTER]));
    ridpointers[(int) RID_COMPLEX] = get_identifier ("__complex");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_COMPLEX],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_COMPLEX]));
  
    /* C++ extensions. These are probably not correctly named.  */
    ridpointers[(int) RID_WCHAR] = get_identifier ("__wchar_t");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_WCHAR],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_WCHAR]));
    class_type_node = build_int_2 (class_type, 0);
    TREE_TYPE (class_type_node) = class_type_node;
    ridpointers[(int) RID_CLASS] = class_type_node;
--- 679,706 ----
*************** init_parse (filename)
*** 760,793 ****
    ridpointers[(int) RID_ENUM] = enum_type_node;
  
    ridpointers[(int) RID_VIRTUAL] = get_identifier ("virtual");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_VIRTUAL],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_VIRTUAL]));
    ridpointers[(int) RID_EXPLICIT] = get_identifier ("explicit");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_EXPLICIT],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_EXPLICIT]));
    ridpointers[(int) RID_EXPORT] = get_identifier ("export");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_EXPORT],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_EXPORT]));
    ridpointers[(int) RID_FRIEND] = get_identifier ("friend");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_FRIEND],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_FRIEND]));
  
    ridpointers[(int) RID_PUBLIC] = get_identifier ("public");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_PUBLIC],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_PUBLIC]));
    ridpointers[(int) RID_PRIVATE] = get_identifier ("private");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_PRIVATE],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_PRIVATE]));
    ridpointers[(int) RID_PROTECTED] = get_identifier ("protected");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_PROTECTED],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_PROTECTED]));
    ridpointers[(int) RID_TEMPLATE] = get_identifier ("template");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_TEMPLATE],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_TEMPLATE]));
    /* This is for ANSI C++.  */
    ridpointers[(int) RID_MUTABLE] = get_identifier ("mutable");
-   SET_IDENTIFIER_AS_LIST (ridpointers[(int) RID_MUTABLE],
- 			  build_tree_list (NULL_TREE, ridpointers[(int) RID_MUTABLE]));
  
    /* Signature handling extensions.  */
    signature_type_node = build_int_2 (signature_type, 0);
--- 718,733 ----
*************** make_lang_type (code)
*** 4724,4735 ****
        bzero ((char *) pi, (int) sizeof (struct lang_type));
  
        TYPE_LANG_SPECIFIC (t) = pi;
-       CLASSTYPE_AS_LIST (t) = build_expr_list (NULL_TREE, t);
        SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown);
        CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
        TYPE_BINFO (t) = make_binfo (integer_zero_node, t, NULL_TREE, NULL_TREE);
-       CLASSTYPE_BINFO_AS_LIST (t) 
- 	= build_tree_list (NULL_TREE, TYPE_BINFO (t));
  
        /* Make sure this is laid out, for ease of use later.  In the
  	 presence of parse errors, the normal was of assuring this
--- 4664,4672 ----
Index: parse.y
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/parse.y,v
retrieving revision 1.111
diff -c -p -r1.111 parse.y
*** parse.y	1999/03/27 17:33:34	1.111
--- parse.y	1999/03/31 07:22:46
*************** parse_decl(declarator, specs_attrs, attr
*** 319,325 ****
    split_specs_attrs (specs_attrs, &current_declspecs, &prefix_attributes);
    if (current_declspecs
        && TREE_CODE (current_declspecs) != TREE_LIST)
!     current_declspecs = get_decl_list (current_declspecs);
    if (have_extern_spec && !used_extern_spec)
      {
        current_declspecs = decl_tree_cons (NULL_TREE, 
--- 319,325 ----
    split_specs_attrs (specs_attrs, &current_declspecs, &prefix_attributes);
    if (current_declspecs
        && TREE_CODE (current_declspecs) != TREE_LIST)
!     current_declspecs = build_decl_list (NULL_TREE, current_declspecs);
    if (have_extern_spec && !used_extern_spec)
      {
        current_declspecs = decl_tree_cons (NULL_TREE, 
*************** type_id:
*** 1686,1692 ****
  		{ $$.t = build_decl_list ($1.t, $2); 
  		  $$.new_type_flag = $1.new_type_flag; }
  	| typespec absdcl
! 		{ $$.t = build_decl_list (get_decl_list ($1.t), $2); 
  		  $$.new_type_flag = $1.new_type_flag; }
  	| typed_typespecs  %prec EMPTY
  		{ $$.t = build_decl_list ($1.t, NULL_TREE);
--- 1686,1693 ----
  		{ $$.t = build_decl_list ($1.t, $2); 
  		  $$.new_type_flag = $1.new_type_flag; }
  	| typespec absdcl
! 		{ $$.t = build_decl_list (build_decl_list (NULL_TREE, $1.t),
! 					  $2); 
  		  $$.new_type_flag = $1.new_type_flag; }
  	| typed_typespecs  %prec EMPTY
  		{ $$.t = build_decl_list ($1.t, NULL_TREE);
*************** declmods:
*** 1756,1762 ****
  	  nonempty_cv_qualifiers  %prec EMPTY
  		{ $$ = $1.t; TREE_STATIC ($$) = 1; }
  	| SCSPEC
! 		{ $$ = IDENTIFIER_AS_LIST ($$); }
  	| declmods CV_QUALIFIER
  		{ $$ = decl_tree_cons (NULL_TREE, $2, $$);
  		  TREE_STATIC ($$) = 1; }
--- 1757,1763 ----
  	  nonempty_cv_qualifiers  %prec EMPTY
  		{ $$ = $1.t; TREE_STATIC ($$) = 1; }
  	| SCSPEC
! 		{ $$ = build_decl_list (NULL_TREE, $$); }
  	| declmods CV_QUALIFIER
  		{ $$ = decl_tree_cons (NULL_TREE, $2, $$);
  		  TREE_STATIC ($$) = 1; }
*************** declmods:
*** 1780,1786 ****
  
  typed_typespecs:
  	  typespec  %prec EMPTY
! 		{ $$.t = get_decl_list ($1.t); 
  		  $$.new_type_flag = $1.new_type_flag; }
  	| nonempty_cv_qualifiers typespec
  		{ $$.t = decl_tree_cons (NULL_TREE, $2.t, $1.t); 
--- 1781,1787 ----
  
  typed_typespecs:
  	  typespec  %prec EMPTY
! 		{ $$.t = build_decl_list (NULL_TREE, $1.t); 
  		  $$.new_type_flag = $1.new_type_flag; }
  	| nonempty_cv_qualifiers typespec
  		{ $$.t = decl_tree_cons (NULL_TREE, $2.t, $1.t); 
*************** cv_qualifiers:
*** 2688,2694 ****
  
  nonempty_cv_qualifiers:
  	  CV_QUALIFIER
! 		{ $$.t = IDENTIFIER_AS_LIST ($1); 
  		  $$.new_type_flag = 0; }
  	| nonempty_cv_qualifiers CV_QUALIFIER
  		{ $$.t = decl_tree_cons (NULL_TREE, $2, $1.t); 
--- 2689,2695 ----
  
  nonempty_cv_qualifiers:
  	  CV_QUALIFIER
! 		{ $$.t = build_decl_list (NULL_TREE, $1); 
  		  $$.new_type_flag = 0; }
  	| nonempty_cv_qualifiers CV_QUALIFIER
  		{ $$.t = decl_tree_cons (NULL_TREE, $2, $1.t); 
*************** named_parm:
*** 3578,3584 ****
  		{ $$.t = build_tree_list ($1.t, $2); 
  		  $$.new_type_flag = $1.new_type_flag; }
  	| typespec declarator
! 		{ $$.t = build_tree_list (get_decl_list ($1.t), $2); 
  		  $$.new_type_flag = $1.new_type_flag; }
  	| typed_declspecs1 absdcl
  		{ tree specs = strip_attrs ($1.t);
--- 3579,3586 ----
  		{ $$.t = build_tree_list ($1.t, $2); 
  		  $$.new_type_flag = $1.new_type_flag; }
  	| typespec declarator
! 		{ $$.t = build_tree_list (build_decl_list (NULL_TREE, $1.t),
! 					  $2); 
  		  $$.new_type_flag = $1.new_type_flag; }
  	| typed_declspecs1 absdcl
  		{ tree specs = strip_attrs ($1.t);
Index: ptree.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/ptree.c,v
retrieving revision 1.15
diff -c -p -r1.15 ptree.c
*** ptree.c	1999/03/24 01:10:11	1.15
--- ptree.c	1999/03/31 07:22:46
***************
*** 1,5 ****
  /* Prints out trees in human readable form.
!    Copyright (C) 1992, 93-96, 1998 Free Software Foundation, Inc.
     Hacked by Michael Tiemann (tiemann@cygnus.com)
  
  This file is part of GNU CC.
--- 1,5 ----
  /* Prints out trees in human readable form.
!    Copyright (C) 1992, 93-96, 1998, 1999 Free Software Foundation, Inc.
     Hacked by Michael Tiemann (tiemann@cygnus.com)
  
  This file is part of GNU CC.
*************** print_lang_type (file, node, indent)
*** 126,143 ****
  
    if (TREE_CODE (node) == RECORD_TYPE)
      {
!       fprintf (file, " n_parents %d n_ancestors %d",
! 	       CLASSTYPE_N_BASECLASSES (node),
! 	       CLASSTYPE_N_SUPERCLASSES (node));
        fprintf (file, " use_template=%d", CLASSTYPE_USE_TEMPLATE (node));
        if (CLASSTYPE_INTERFACE_ONLY (node))
  	fprintf (file, " interface-only");
        if (CLASSTYPE_INTERFACE_UNKNOWN (node))
  	fprintf (file, " interface-unknown");
        print_node (file, "member-functions", CLASSTYPE_METHOD_VEC (node),
- 		  indent + 4);
-       print_node (file, "baselinks",
- 		  TYPE_BINFO_BASETYPES (node) ? CLASSTYPE_BASELINK_VEC (node) : NULL_TREE,
  		  indent + 4);
      }
  }
--- 126,138 ----
  
    if (TREE_CODE (node) == RECORD_TYPE)
      {
!       fprintf (file, " n_parents %d", CLASSTYPE_N_BASECLASSES (node));
        fprintf (file, " use_template=%d", CLASSTYPE_USE_TEMPLATE (node));
        if (CLASSTYPE_INTERFACE_ONLY (node))
  	fprintf (file, " interface-only");
        if (CLASSTYPE_INTERFACE_UNKNOWN (node))
  	fprintf (file, " interface-unknown");
        print_node (file, "member-functions", CLASSTYPE_METHOD_VEC (node),
  		  indent + 4);
      }
  }
Index: search.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/search.c,v
retrieving revision 1.89
diff -c -p -r1.89 search.c
*** search.c	1999/03/26 07:44:53	1.89
--- search.c	1999/03/31 07:22:47
*************** pop_stack_level (stack)
*** 78,83 ****
--- 78,84 ----
  static struct search_level *search_stack;
  
  static tree get_abstract_virtuals_1 PROTO((tree, int, tree));
+ static tree next_baselink PROTO((tree));
  static tree get_vbase_1 PROTO((tree, tree, unsigned int *));
  static tree convert_pointer_to_vbase PROTO((tree, tree));
  static tree lookup_field_1 PROTO((tree, tree));
*************** get_abstract_virtuals (type)
*** 2041,2117 ****
    return nreverse (abstract_virtuals);
  }
  
! /* For the type TYPE, return a list of member functions available from
!    base classes with name NAME.  The TREE_VALUE of the list is a chain of
!    member functions with name NAME.  The TREE_PURPOSE of the list is a
!    basetype, or a list of base types (in reverse order) which were
!    traversed to reach the chain of member functions.  If we reach a base
!    type which provides a member function of name NAME, and which has at
!    most one base type itself, then we can terminate the search.  */
! 
! tree
! get_baselinks (type_as_binfo_list, type, name)
!      tree type_as_binfo_list;
!      tree type, name;
! {
!   int head = 0, tail = 0, idx;
!   tree rval = 0, nval = 0;
!   tree basetypes = type_as_binfo_list;
!   tree binfo = TYPE_BINFO (type);
! 
!   search_stack = push_search_level (search_stack, &search_obstack);
! 
!   while (1)
!     {
!       tree binfos = BINFO_BASETYPES (binfo);
!       int i, n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0;
! 
!       /* Process and/or queue base types.  */
!       for (i = 0; i < n_baselinks; i++)
! 	{
! 	  tree base_binfo = TREE_VEC_ELT (binfos, i);
! 	  tree btypes;
! 
! 	  btypes = hash_tree_cons (TREE_VIA_PUBLIC (base_binfo),
! 				   TREE_VIA_VIRTUAL (base_binfo),
! 				   TREE_VIA_PROTECTED (base_binfo),
! 				   NULL_TREE, base_binfo,
! 				   basetypes);
! 	  obstack_ptr_grow (&search_obstack, btypes);
! 	  search_stack->first = (tree *)obstack_base (&search_obstack);
! 	  tail += 1;
! 	}
! 
!     dont_queue:
!       /* Process head of queue, if one exists.  */
!       if (head >= tail)
! 	break;
! 
!       basetypes = search_stack->first[head++];
!       binfo = TREE_VALUE (basetypes);
!       type = BINFO_TYPE (binfo);
!       idx = lookup_fnfields_1 (type, name);
!       if (idx >= 0)
! 	{
! 	  nval = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), idx);
! 	  rval = hash_tree_cons (0, 0, 0, basetypes, nval, rval);
! 	  if (TYPE_BINFO_BASETYPES (type) == 0)
! 	    goto dont_queue;
! 	  else if (TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES (type)) == 1)
! 	    {
! 	      if (CLASSTYPE_BASELINK_VEC (type))
! 		TREE_TYPE (rval) = TREE_VEC_ELT (CLASSTYPE_BASELINK_VEC (type), idx);
! 	      goto dont_queue;
! 	    }
! 	}
!       nval = NULL_TREE;
!     }
! 
!   search_stack = pop_search_level (search_stack);
!   return rval;
! }
! 
! tree
  next_baselink (baselink)
       tree baselink;
  {
--- 2042,2048 ----
    return nreverse (abstract_virtuals);
  }
  
! static tree
  next_baselink (baselink)
       tree baselink;
  {
Index: semantics.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/semantics.c,v
retrieving revision 1.43
diff -c -p -r1.43 semantics.c
*** semantics.c	1999/03/13 01:16:33	1.43
--- semantics.c	1999/03/31 07:22:47
*************** finish_class_definition (t, attributes, 
*** 1432,1443 ****
       tree attributes;
       int semi;
  {
- #if 0
-   /* Need to rework class nesting in the presence of nested classes,
-      etc.  */
-   shadow_tag (CLASSTYPE_AS_LIST (t)); */
- #endif
- 
    /* finish_struct nukes this anyway; if finish_exception does too,
       then it can go.  */
    if (semi)
--- 1432,1437 ----
Index: tree.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/tree.c,v
retrieving revision 1.101
diff -c -p -r1.101 tree.c
*** tree.c	1999/03/26 07:44:55	1.101
--- tree.c	1999/03/31 07:22:47
*************** Boston, MA 02111-1307, USA.  */
*** 28,34 ****
  #include "rtl.h"
  #include "toplev.h"
  
- static tree get_identifier_list PROTO((tree));
  static tree bot_manip PROTO((tree));
  static tree perm_manip PROTO((tree));
  static tree build_cplus_array_type_1 PROTO((tree, tree));
--- 28,33 ----
*************** hash_chainon (list1, list2)
*** 1086,1145 ****
      return hash_tree_chain (TREE_VALUE (list1), list2);
    return hash_tree_chain (TREE_VALUE (list1),
  			  hash_chainon (TREE_CHAIN (list1), list2));
- }
- 
- static tree
- get_identifier_list (value)
-      tree value;
- {
-   tree list = IDENTIFIER_AS_LIST (value);
-   if (list != NULL_TREE
-       && (TREE_CODE (list) != TREE_LIST
- 	  || TREE_VALUE (list) != value))
-     list = NULL_TREE;
-   else if (IDENTIFIER_HAS_TYPE_VALUE (value)
- 	   && TREE_CODE (IDENTIFIER_TYPE_VALUE (value)) == RECORD_TYPE
- 	   && IDENTIFIER_TYPE_VALUE (value)
- 	      == TYPE_MAIN_VARIANT (IDENTIFIER_TYPE_VALUE (value)))
-     {
-       tree type = IDENTIFIER_TYPE_VALUE (value);
- 
-       if (TYPE_PTRMEMFUNC_P (type))
- 	list = NULL_TREE;
-       else if (type == current_class_type)
- 	/* Don't mess up the constructor name.  */
- 	list = tree_cons (NULL_TREE, value, NULL_TREE);
-       else
- 	{
- 	  if (! CLASSTYPE_ID_AS_LIST (type))
- 	    CLASSTYPE_ID_AS_LIST (type)
- 	      = perm_tree_cons (NULL_TREE, TYPE_IDENTIFIER (type), NULL_TREE);
- 	  list = CLASSTYPE_ID_AS_LIST (type);
- 	}
-     }
-   return list;
- }
- 
- tree
- get_decl_list (value)
-      tree value;
- {
-   tree list = NULL_TREE;
- 
-   if (TREE_CODE (value) == IDENTIFIER_NODE)
-     list = get_identifier_list (value);
-   else if (TREE_CODE (value) == RECORD_TYPE
- 	   && TYPE_LANG_SPECIFIC (value)
- 	   && value == TYPE_MAIN_VARIANT (value))
-     list = CLASSTYPE_AS_LIST (value);
- 
-   if (list != NULL_TREE)
-     {
-       my_friendly_assert (TREE_CHAIN (list) == NULL_TREE, 301);
-       return list;
-     }
- 
-   return build_decl_list (NULL_TREE, value);
  }
  
  /* Build an association between TYPE and some parameters:
--- 1085,1090 ----


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