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: Don't use build_lang_decl for FIELD_DECLs



This patch saves some memory by using build_decl, rather than
build_lang_decl, to build FIELD_DECLs.  Every little bit helps.

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

2000-05-23  Mark Mitchell  <mark@codesourcery.com>

	* cp-tree.h (lang_decl_flags): Rename mutable_flag to uninlinable
	and bitfield to tinfo_fn_p.
	(DECL_TINFO_FN_P): Adjust.
	(SET_DECL_TINFO_FN_P): Likewise.
	(DECL_MUTABLE_P): Likewise.
	(DECL_C_BIT_FIELD): Likewise.
	(SET_DECL_C_BIT_FIELD): Likewise.
	(CLEAR_DECL_C_BIT_FIELD): Likewise.
	(DECL_UNINLINABLE): Likewise.
	* class.c (alter_access): Call retrofit_lang_decl if ncessary.
	(handle_using_decl): Remove assertion.
	(build_vtbl_or_vbase_field): Use build_decl, not build_lang_decl,
	to build FIELD_DECLs.
	(build_base_field): Likewise.
	(layout_class_type): Likewise.
	* decl.c (init_decl_processing): Likewise.
	(build_ptrmemfunc_type): Likewise.
	(grokdeclarator): Likewise.
	* decl2.c (grok_x_components): Likewise.
	* except.c (call_eh_info): Likewise.
	* init.c (init_init_processing): Likewise.
	* rtti.c (expand_class_desc): Likewise.
	(create_pseudo_type_info): Likewise.
	(get_vmi_pseudo_type_info): Likewise.
	(create_tinfo_types): Likewise.
	* ptree.c (print_lang_decl): Adjust.
	* typeck.c (build_component_ref): Don't check DECL_LANG_SPECIFIC
	before checking DECL_MUTABLE_P.

Index: class.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/class.c,v
retrieving revision 1.305
diff -c -p -r1.305 class.c
*** class.c	2000/05/23 06:31:16	1.305
--- class.c	2000/05/24 06:08:01
*************** alter_access (t, fdecl, access)
*** 1435,1441 ****
       tree fdecl;
       tree access;
  {
!   tree elem = purpose_member (t, DECL_ACCESS (fdecl));
    if (elem)
      {
        if (TREE_VALUE (elem) != access)
--- 1435,1446 ----
       tree fdecl;
       tree access;
  {
!   tree elem;
! 
!   if (!DECL_LANG_SPECIFIC (fdecl))
!     retrofit_lang_decl (fdecl);
! 
!   elem = purpose_member (t, DECL_ACCESS (fdecl));
    if (elem)
      {
        if (TREE_VALUE (elem) != access)
*************** handle_using_decl (using_decl, t)
*** 1516,1523 ****
  
    if (is_overloaded_fn (fdecl))
      flist = fdecl;
-   else if (! DECL_LANG_SPECIFIC (fdecl))
-     my_friendly_abort (20000221);
  
    if (! old_value)
      ;
--- 1521,1526 ----
*************** build_vtbl_or_vbase_field (name, assembl
*** 3540,3546 ****
    *empty_p = 0;
  
    /* Build the FIELD_DECL.  */
!   field = build_lang_decl (FIELD_DECL, name, type);
    DECL_ASSEMBLER_NAME (field) = assembler_name;
    DECL_VIRTUAL_P (field) = 1;
    DECL_ARTIFICIAL (field) = 1;
--- 3543,3549 ----
    *empty_p = 0;
  
    /* Build the FIELD_DECL.  */
!   field = build_decl (FIELD_DECL, name, type);
    DECL_ASSEMBLER_NAME (field) = assembler_name;
    DECL_VIRTUAL_P (field) = 1;
    DECL_ARTIFICIAL (field) = 1;
*************** build_base_field (rli, binfo, empty_p, b
*** 3760,3766 ****
         location information.  */
      return;
    
!   decl = build_lang_decl (FIELD_DECL, NULL_TREE, basetype);
    DECL_ARTIFICIAL (decl) = 1;
    DECL_FIELD_CONTEXT (decl) = rli->t;
    DECL_SIZE (decl) = CLASSTYPE_SIZE (basetype);
--- 3763,3769 ----
         location information.  */
      return;
    
!   decl = build_decl (FIELD_DECL, NULL_TREE, basetype);
    DECL_ARTIFICIAL (decl) = 1;
    DECL_FIELD_CONTEXT (decl) = rli->t;
    DECL_SIZE (decl) = CLASSTYPE_SIZE (basetype);
*************** layout_class_type (t, empty_p, vfuns_p, 
*** 4755,4761 ****
      {
        tree padding;
  
!       padding = build_lang_decl (FIELD_DECL, NULL_TREE, char_type_node);
        place_field (rli, padding);
        TYPE_NONCOPIED_PARTS (t) 
  	= tree_cons (NULL_TREE, padding, TYPE_NONCOPIED_PARTS (t));
--- 4758,4764 ----
      {
        tree padding;
  
!       padding = build_decl (FIELD_DECL, NULL_TREE, char_type_node);
        place_field (rli, padding);
        TYPE_NONCOPIED_PARTS (t) 
  	= tree_cons (NULL_TREE, padding, TYPE_NONCOPIED_PARTS (t));
Index: cp-tree.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/cp-tree.h,v
retrieving revision 1.458
diff -c -p -r1.458 cp-tree.h
*** cp-tree.h	2000/05/22 22:52:31	1.458
--- cp-tree.h	2000/05/24 06:08:05
*************** Boston, MA 02111-1307, USA.  */
*** 90,97 ****
--- 90,99 ----
     0: DECL_ERROR_REPORTED (in VAR_DECL).
        DECL_TEMPLATE_PARM_P (in CONST_DECL, TYPE_DECL, or TEMPLATE_DECL)
        DECL_LOCAL_FUNCTION_P (in FUNCTION_DECL)
+       DECL_MUTABLE_P (in FIELD_DECL)
     1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL).
        DECL_TEMPLATE_INSTANTIATED (in a VAR_DECL or a FUNCTION_DECL)
+       DECL_C_BITFIELD (in FIELD_DECL)
     2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL).
        DECL_IMPLICIT_TYPEDEF_P (in a TYPE_DECL)
     3: DECL_IN_AGGR_P.
*************** struct lang_decl_flags
*** 1829,1848 ****
    unsigned static_function : 1;
    unsigned pure_virtual : 1;
    unsigned has_in_charge_parm_p : 1;
!   unsigned bitfield : 1;
  
-   unsigned mutable_flag : 1;
    unsigned deferred : 1;
    unsigned use_template : 2;
    unsigned nonconverting : 1;
    unsigned declared_inline : 1;
    unsigned not_really_extern : 1;
    unsigned needs_final_overrider : 1;
- 
    unsigned defined_in_class : 1;
    unsigned pending_inline_p : 1;
    unsigned global_ctor_p : 1;
    unsigned global_dtor_p : 1;
    unsigned dummy : 4;
  
    tree context;
--- 1831,1850 ----
    unsigned static_function : 1;
    unsigned pure_virtual : 1;
    unsigned has_in_charge_parm_p : 1;
!   unsigned uninlinable : 1;
  
    unsigned deferred : 1;
    unsigned use_template : 2;
    unsigned nonconverting : 1;
    unsigned declared_inline : 1;
    unsigned not_really_extern : 1;
    unsigned needs_final_overrider : 1;
    unsigned defined_in_class : 1;
+ 
    unsigned pending_inline_p : 1;
    unsigned global_ctor_p : 1;
    unsigned global_dtor_p : 1;
+   unsigned tinfo_fn_p : 1;
    unsigned dummy : 4;
  
    tree context;
*************** struct lang_decl
*** 1989,1999 ****
  #define DECL_TINFO_FN_P(NODE) 					\
    (TREE_CODE (NODE) == FUNCTION_DECL				\
     && DECL_ARTIFICIAL (NODE)					\
!    && DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)
  
  /* Mark NODE as a type-info function.  */
  #define SET_DECL_TINFO_FN_P(NODE) \
!   (DECL_LANG_SPECIFIC((NODE))->decl_flags.mutable_flag = 1)
  
  /* Nonzero if NODE is an overloaded `operator delete[]' function.  */
  #define DECL_ARRAY_DELETE_OPERATOR_P(NODE) \
--- 1991,2001 ----
  #define DECL_TINFO_FN_P(NODE) 					\
    (TREE_CODE (NODE) == FUNCTION_DECL				\
     && DECL_ARTIFICIAL (NODE)					\
!    && DECL_LANG_SPECIFIC(NODE)->decl_flags.tinfo_fn_p)
  
  /* Mark NODE as a type-info function.  */
  #define SET_DECL_TINFO_FN_P(NODE) \
!   (DECL_LANG_SPECIFIC((NODE))->decl_flags.tinfo_fn_p = 1)
  
  /* Nonzero if NODE is an overloaded `operator delete[]' function.  */
  #define DECL_ARRAY_DELETE_OPERATOR_P(NODE) \
*************** struct lang_decl
*** 2055,2061 ****
  
  /* Nonzero for _DECL means that this member object type
     is mutable.  */
! #define DECL_MUTABLE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag)
  
  /* Nonzero for _DECL means that this constructor is a non-converting
     constructor.  */
--- 2057,2063 ----
  
  /* Nonzero for _DECL means that this member object type
     is mutable.  */
! #define DECL_MUTABLE_P(NODE) (DECL_LANG_FLAG_0 (NODE))
  
  /* Nonzero for _DECL means that this constructor is a non-converting
     constructor.  */
*************** extern int flag_new_for_scope;
*** 2427,2442 ****
  
  /* In a FIELD_DECL, nonzero if the decl was originally a bitfield.  */
  #define DECL_C_BIT_FIELD(NODE) \
!   (DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE))\
!    && DECL_LANG_SPECIFIC (NODE)->decl_flags.bitfield)
  #define SET_DECL_C_BIT_FIELD(NODE) \
!   (DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE))->decl_flags.bitfield = 1)
  #define CLEAR_DECL_C_BIT_FIELD(NODE) \
!   (DECL_LANG_SPECIFIC (FIELD_DECL_CHECK (NODE))->decl_flags.bitfield = 0)
  
  /* In a FUNCTION_DECL, nonzero if the function cannot be inlined.  */
  #define DECL_UNINLINABLE(NODE) \
!   (DECL_LANG_SPECIFIC (NODE)->decl_flags.bitfield)
  
  #define INTEGRAL_CODE_P(CODE) \
    (CODE == INTEGER_TYPE || CODE == ENUMERAL_TYPE || CODE == BOOLEAN_TYPE)
--- 2429,2443 ----
  
  /* In a FIELD_DECL, nonzero if the decl was originally a bitfield.  */
  #define DECL_C_BIT_FIELD(NODE) \
!   (DECL_LANG_FLAG_1 (FIELD_DECL_CHECK (NODE)) == 1)
  #define SET_DECL_C_BIT_FIELD(NODE) \
!   (DECL_LANG_FLAG_1 (FIELD_DECL_CHECK (NODE)) = 1)
  #define CLEAR_DECL_C_BIT_FIELD(NODE) \
!   (DECL_LANG_FLAG_1 (FIELD_DECL_CHECK (NODE)) = 0)
  
  /* In a FUNCTION_DECL, nonzero if the function cannot be inlined.  */
  #define DECL_UNINLINABLE(NODE) \
!   (DECL_LANG_SPECIFIC (NODE)->decl_flags.uninlinable)
  
  #define INTEGRAL_CODE_P(CODE) \
    (CODE == INTEGER_TYPE || CODE == ENUMERAL_TYPE || CODE == BOOLEAN_TYPE)
Index: decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.609
diff -c -p -r1.609 decl.c
*** decl.c	2000/05/22 22:52:31	1.609
--- decl.c	2000/05/24 06:08:14
*************** init_decl_processing ()
*** 6384,6395 ****
    else
      {
        vtable_entry_type = make_aggr_type (RECORD_TYPE);
!       fields[0] = build_lang_decl (FIELD_DECL, delta_identifier,
! 				   delta_type_node);
!       fields[1] = build_lang_decl (FIELD_DECL, index_identifier,
! 				   delta_type_node);
!       fields[2] = build_lang_decl (FIELD_DECL, pfn_identifier,
! 				   ptr_type_node);
        finish_builtin_type (vtable_entry_type, VTBL_PTR_TYPE, fields, 2,
  			   double_type_node);
  
--- 6384,6395 ----
    else
      {
        vtable_entry_type = make_aggr_type (RECORD_TYPE);
!       fields[0] = build_decl (FIELD_DECL, delta_identifier,
! 			      delta_type_node);
!       fields[1] = build_decl (FIELD_DECL, index_identifier,
! 			      delta_type_node);
!       fields[2] = build_decl (FIELD_DECL, pfn_identifier,
! 			      ptr_type_node);
        finish_builtin_type (vtable_entry_type, VTBL_PTR_TYPE, fields, 2,
  			   double_type_node);
  
*************** build_ptrmemfunc_type (type)
*** 9031,9054 ****
      {
        u = make_aggr_type (UNION_TYPE);
        SET_IS_AGGR_TYPE (u, 0);
!       fields[0] = build_lang_decl (FIELD_DECL, pfn_identifier, type);
!       fields[1] = build_lang_decl (FIELD_DECL, delta2_identifier,
! 				   delta_type_node);
        finish_builtin_type (u, "__ptrmemfunc_type", fields, 1, ptr_type_node);
        TYPE_NAME (u) = NULL_TREE;
  
!       fields[0] = build_lang_decl (FIELD_DECL, delta_identifier,
! 				   delta_type_node);
!       fields[1] = build_lang_decl (FIELD_DECL, index_identifier,
! 				   delta_type_node);
!       fields[2] = build_lang_decl (FIELD_DECL, pfn_or_delta2_identifier, u);
        finish_builtin_type (t, "__ptrmemfunc_type", fields, 2, ptr_type_node);
      }
    else
      {
!       fields[0] = build_lang_decl (FIELD_DECL, pfn_identifier, type);
!       fields[1] = build_lang_decl (FIELD_DECL, delta_identifier,
! 				   delta_type_node);
        finish_builtin_type (t, "__ptrmemfunc_type", fields, 1, ptr_type_node);
      }
  
--- 9031,9054 ----
      {
        u = make_aggr_type (UNION_TYPE);
        SET_IS_AGGR_TYPE (u, 0);
!       fields[0] = build_decl (FIELD_DECL, pfn_identifier, type);
!       fields[1] = build_decl (FIELD_DECL, delta2_identifier,
! 			      delta_type_node);
        finish_builtin_type (u, "__ptrmemfunc_type", fields, 1, ptr_type_node);
        TYPE_NAME (u) = NULL_TREE;
  
!       fields[0] = build_decl (FIELD_DECL, delta_identifier,
! 			      delta_type_node);
!       fields[1] = build_decl (FIELD_DECL, index_identifier,
! 			      delta_type_node);
!       fields[2] = build_decl (FIELD_DECL, pfn_or_delta2_identifier, u);
        finish_builtin_type (t, "__ptrmemfunc_type", fields, 2, ptr_type_node);
      }
    else
      {
!       fields[0] = build_decl (FIELD_DECL, pfn_identifier, type);
!       fields[1] = build_decl (FIELD_DECL, delta_identifier,
! 			      delta_type_node);
        finish_builtin_type (t, "__ptrmemfunc_type", fields, 1, ptr_type_node);
      }
  
*************** grokdeclarator (declarator, declspecs, d
*** 11411,11417 ****
  	      }
  	    else
  	      {
! 		decl = build_lang_decl (FIELD_DECL, declarator, type);
  		if (RIDBIT_SETP (RID_MUTABLE, specbits))
  		  {
  		    DECL_MUTABLE_P (decl) = 1;
--- 11411,11417 ----
  	      }
  	    else
  	      {
! 		decl = build_decl (FIELD_DECL, declarator, type);
  		if (RIDBIT_SETP (RID_MUTABLE, specbits))
  		  {
  		    DECL_MUTABLE_P (decl) = 1;
Index: decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.351
diff -c -p -r1.351 decl2.c
*** decl2.c	2000/05/24 04:34:37	1.351
--- decl2.c	2000/05/24 06:08:18
*************** grok_x_components (specs)
*** 914,920 ****
      return;
  
    fixup_anonymous_aggr (t);
!   finish_member_declaration (build_lang_decl (FIELD_DECL, NULL_TREE, t)); 
  
    /* Ignore any inline function definitions in the anonymous union
       since an anonymous union may not have function members.  */
--- 914,920 ----
      return;
  
    fixup_anonymous_aggr (t);
!   finish_member_declaration (build_decl (FIELD_DECL, NULL_TREE, t)); 
  
    /* Ignore any inline function definitions in the anonymous union
       since an anonymous union may not have function members.  */
Index: except.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/except.c,v
retrieving revision 1.110
diff -c -p -r1.110 except.c
*** except.c	2000/05/20 19:45:36	1.110
--- except.c	2000/05/24 06:08:18
*************** call_eh_info ()
*** 210,222 ****
        /* struct cp_eh_info.  This must match exception.cc.  Note that this
  	 type is not pushed anywhere.  */
        t1= make_aggr_type (RECORD_TYPE);
!       fields[0] = build_lang_decl (FIELD_DECL, 
                      get_identifier ("handler_label"), ptr_type_node);
!       fields[1] = build_lang_decl (FIELD_DECL, 
                      get_identifier ("dynamic_handler_chain"), ptr_type_node);
!       fields[2] = build_lang_decl (FIELD_DECL, 
                      get_identifier ("info"), ptr_type_node);
!       fields[3] = build_lang_decl (FIELD_DECL, 
                      get_identifier ("table_index"), ptr_type_node);
        /* N.B.: The fourth field LEN is expected to be
  	 the number of fields - 1, not the total number of fields.  */
--- 210,222 ----
        /* struct cp_eh_info.  This must match exception.cc.  Note that this
  	 type is not pushed anywhere.  */
        t1= make_aggr_type (RECORD_TYPE);
!       fields[0] = build_decl (FIELD_DECL, 
                      get_identifier ("handler_label"), ptr_type_node);
!       fields[1] = build_decl (FIELD_DECL, 
                      get_identifier ("dynamic_handler_chain"), ptr_type_node);
!       fields[2] = build_decl (FIELD_DECL, 
                      get_identifier ("info"), ptr_type_node);
!       fields[3] = build_decl (FIELD_DECL, 
                      get_identifier ("table_index"), ptr_type_node);
        /* N.B.: The fourth field LEN is expected to be
  	 the number of fields - 1, not the total number of fields.  */
*************** call_eh_info ()
*** 224,255 ****
        t1 = build_pointer_type (t1);
  
        t1= make_aggr_type (RECORD_TYPE);
!       fields[0] = build_lang_decl (FIELD_DECL, 
                      get_identifier ("match_function"), ptr_type_node);
!       fields[1] = build_lang_decl (FIELD_DECL, 
                      get_identifier ("language"), short_integer_type_node);
!       fields[2] = build_lang_decl (FIELD_DECL, 
                      get_identifier ("version"), short_integer_type_node);
        /* N.B.: The fourth field LEN is expected to be
  	 the number of fields - 1, not the total number of fields.  */
        finish_builtin_type (t1, "__eh_info", fields, 2, ptr_type_node);
        t = make_aggr_type (RECORD_TYPE);
!       fields[0] = build_lang_decl (FIELD_DECL, 
! 				   get_identifier ("eh_info"), t1);
!       fields[1] = build_lang_decl (FIELD_DECL, get_identifier ("value"),
! 				   ptr_type_node);
!       fields[2] = build_lang_decl (FIELD_DECL, get_identifier ("type"),
! 				   ptr_type_node);
!       fields[3] = build_lang_decl
  	(FIELD_DECL, get_identifier ("cleanup"),
  	 build_pointer_type (build_function_type
  			     (ptr_type_node, tree_cons
  			      (NULL_TREE, ptr_type_node, void_list_node))));
!       fields[4] = build_lang_decl (FIELD_DECL, get_identifier ("caught"),
! 				   boolean_type_node);
!       fields[5] = build_lang_decl (FIELD_DECL, get_identifier ("next"),
! 				   build_pointer_type (t));
!       fields[6] = build_lang_decl
  	(FIELD_DECL, get_identifier ("handlers"), long_integer_type_node);
        /* N.B.: The fourth field LEN is expected to be
  	 the number of fields - 1, not the total number of fields.  */
--- 224,255 ----
        t1 = build_pointer_type (t1);
  
        t1= make_aggr_type (RECORD_TYPE);
!       fields[0] = build_decl (FIELD_DECL, 
                      get_identifier ("match_function"), ptr_type_node);
!       fields[1] = build_decl (FIELD_DECL, 
                      get_identifier ("language"), short_integer_type_node);
!       fields[2] = build_decl (FIELD_DECL, 
                      get_identifier ("version"), short_integer_type_node);
        /* N.B.: The fourth field LEN is expected to be
  	 the number of fields - 1, not the total number of fields.  */
        finish_builtin_type (t1, "__eh_info", fields, 2, ptr_type_node);
        t = make_aggr_type (RECORD_TYPE);
!       fields[0] = build_decl (FIELD_DECL, 
! 			      get_identifier ("eh_info"), t1);
!       fields[1] = build_decl (FIELD_DECL, get_identifier ("value"),
! 			      ptr_type_node);
!       fields[2] = build_decl (FIELD_DECL, get_identifier ("type"),
! 			      ptr_type_node);
!       fields[3] = build_decl
  	(FIELD_DECL, get_identifier ("cleanup"),
  	 build_pointer_type (build_function_type
  			     (ptr_type_node, tree_cons
  			      (NULL_TREE, ptr_type_node, void_list_node))));
!       fields[4] = build_decl (FIELD_DECL, get_identifier ("caught"),
! 			      boolean_type_node);
!       fields[5] = build_decl (FIELD_DECL, get_identifier ("next"),
! 			      build_pointer_type (t));
!       fields[6] = build_decl
  	(FIELD_DECL, get_identifier ("handlers"), long_integer_type_node);
        /* N.B.: The fourth field LEN is expected to be
  	 the number of fields - 1, not the total number of fields.  */
Index: init.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/init.c,v
retrieving revision 1.190
diff -c -p -r1.190 init.c
*** init.c	2000/05/21 17:01:22	1.190
--- init.c	2000/05/24 06:08:21
*************** void init_init_processing ()
*** 68,74 ****
    /* Define the structure that holds header information for
       arrays allocated via operator new.  */
    BI_header_type = make_aggr_type (RECORD_TYPE);
!   fields[0] = build_lang_decl (FIELD_DECL, nelts_identifier, sizetype);
  
    /* Use the biggest alignment supported by the target to prevent operator
       new from returning misaligned pointers. */
--- 68,74 ----
    /* Define the structure that holds header information for
       arrays allocated via operator new.  */
    BI_header_type = make_aggr_type (RECORD_TYPE);
!   fields[0] = build_decl (FIELD_DECL, nelts_identifier, sizetype);
  
    /* Use the biggest alignment supported by the target to prevent operator
       new from returning misaligned pointers. */
Index: ptree.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/ptree.c,v
retrieving revision 1.24
diff -c -p -r1.24 ptree.c
*** ptree.c	2000/04/10 06:53:57	1.24
--- ptree.c	2000/05/24 06:08:21
*************** print_lang_decl (file, node, indent)
*** 32,47 ****
       tree node;
       int indent;
  {
!   if (!DECL_LANG_SPECIFIC (node))
!     return;
!   /* A FIELD_DECL only has the flags structure, which we aren't displaying
!      anyways.  */
!   if (DECL_MUTABLE_P (node))
      {
!       indent_to (file, indent + 3);
!       fprintf (file, " mutable ");
      }
!   if (TREE_CODE (node) == FIELD_DECL)
      return;
    indent_to (file, indent + 3);
    if (TREE_CODE (node) == FUNCTION_DECL
--- 32,48 ----
       tree node;
       int indent;
  {
!   if (TREE_CODE (node) == FIELD_DECL)
      {
!       if (DECL_MUTABLE_P (node))
! 	{
! 	  indent_to (file, indent + 3);
! 	  fprintf (file, " mutable ");
! 	}
!       return;
      }
! 
!   if (!DECL_LANG_SPECIFIC (node))
      return;
    indent_to (file, indent + 3);
    if (TREE_CODE (node) == FUNCTION_DECL
Index: rtti.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/rtti.c,v
retrieving revision 1.89
diff -c -p -r1.89 rtti.c
*** rtti.c	2000/05/19 23:06:55	1.89
--- rtti.c	2000/05/24 06:08:22
*************** expand_class_desc (tdecl, type)
*** 942,964 ****
        base_desc_type_node = make_aggr_type (RECORD_TYPE);
  
        /* Actually const __user_type_info * */
!       fields [0] = build_lang_decl
  	(FIELD_DECL, NULL_TREE,
  	 build_pointer_type (build_qualified_type
  			     (type_info_type_node,
  			      TYPE_QUAL_CONST)));
!       fields [1] = build_lang_decl
  	(FIELD_DECL, NULL_TREE, 
  	 flag_new_abi ? intSI_type_node : unsigned_intSI_type_node);
        DECL_BIT_FIELD (fields[1]) = 1;
        DECL_SIZE (fields[1]) = bitsize_int (29);
  
!       fields [2] = build_lang_decl (FIELD_DECL, NULL_TREE, boolean_type_node);
        DECL_BIT_FIELD (fields[2]) = 1;
        DECL_SIZE (fields[2]) = bitsize_one_node;
  
        /* Actually enum access */
!       fields [3] = build_lang_decl (FIELD_DECL, NULL_TREE, integer_type_node);
        DECL_BIT_FIELD (fields[3]) = 1;
        DECL_SIZE (fields[3]) = bitsize_int (2);
  
--- 942,964 ----
        base_desc_type_node = make_aggr_type (RECORD_TYPE);
  
        /* Actually const __user_type_info * */
!       fields [0] = build_decl
  	(FIELD_DECL, NULL_TREE,
  	 build_pointer_type (build_qualified_type
  			     (type_info_type_node,
  			      TYPE_QUAL_CONST)));
!       fields [1] = build_decl
  	(FIELD_DECL, NULL_TREE, 
  	 flag_new_abi ? intSI_type_node : unsigned_intSI_type_node);
        DECL_BIT_FIELD (fields[1]) = 1;
        DECL_SIZE (fields[1]) = bitsize_int (29);
  
!       fields [2] = build_decl (FIELD_DECL, NULL_TREE, boolean_type_node);
        DECL_BIT_FIELD (fields[2]) = 1;
        DECL_SIZE (fields[2]) = bitsize_one_node;
  
        /* Actually enum access */
!       fields [3] = build_decl (FIELD_DECL, NULL_TREE, integer_type_node);
        DECL_BIT_FIELD (fields[3]) = 1;
        DECL_SIZE (fields[3]) = bitsize_int (2);
  
*************** create_pseudo_type_info VPARAMS((const c
*** 1758,1764 ****
      }
  
    /* First field is the pseudo type_info base class. */
!   fields[0] = build_lang_decl (FIELD_DECL, NULL_TREE, ti_desc_type_node);
    
    /* Now add the derived fields.  */
    for (ix = 0; (field_decl = va_arg (ap, tree));)
--- 1758,1764 ----
      }
  
    /* First field is the pseudo type_info base class. */
!   fields[0] = build_decl (FIELD_DECL, NULL_TREE, ti_desc_type_node);
    
    /* Now add the derived fields.  */
    for (ix = 0; (field_decl = va_arg (ap, tree));)
*************** get_vmi_pseudo_type_info (num_bases)
*** 1808,1816 ****
  
    desc = create_pseudo_type_info
              ("__vmi_class_type_info", num_bases,
!              build_lang_decl (FIELD_DECL, NULL_TREE, integer_type_node),
!              build_lang_decl (FIELD_DECL, NULL_TREE, integer_type_node),
!              build_lang_decl (FIELD_DECL, NULL_TREE, base_array),
               NULL);
  
    pop_nested_namespace (abi_node);
--- 1808,1816 ----
  
    desc = create_pseudo_type_info
              ("__vmi_class_type_info", num_bases,
!              build_decl (FIELD_DECL, NULL_TREE, integer_type_node),
!              build_decl (FIELD_DECL, NULL_TREE, integer_type_node),
!              build_decl (FIELD_DECL, NULL_TREE, base_array),
               NULL);
  
    pop_nested_namespace (abi_node);
*************** create_tinfo_types ()
*** 1841,1848 ****
      tree fields[2];
  
      ti_desc_type_node = make_aggr_type (RECORD_TYPE);
!     fields[0] = build_lang_decl (FIELD_DECL, NULL_TREE, const_ptr_type_node);
!     fields[1] = build_lang_decl (FIELD_DECL, NULL_TREE, const_string_type_node);
      finish_builtin_type (ti_desc_type_node, "__type_info_pseudo",
                           fields, 1, ptr_type_node);
      TYPE_HAS_CONSTRUCTOR (ti_desc_type_node) = 1;
--- 1841,1848 ----
      tree fields[2];
  
      ti_desc_type_node = make_aggr_type (RECORD_TYPE);
!     fields[0] = build_decl (FIELD_DECL, NULL_TREE, const_ptr_type_node);
!     fields[1] = build_decl (FIELD_DECL, NULL_TREE, const_string_type_node);
      finish_builtin_type (ti_desc_type_node, "__type_info_pseudo",
                           fields, 1, ptr_type_node);
      TYPE_HAS_CONSTRUCTOR (ti_desc_type_node) = 1;
*************** create_tinfo_types ()
*** 1857,1864 ****
       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);
  
    /* Array, function and enum type_info. No additional fields. */
--- 1857,1864 ----
       and pointer to the pointed to type.  */
    ptr_desc_type_node = create_pseudo_type_info
        ("__pointer_type_info", 0,
!        build_decl (FIELD_DECL, NULL_TREE, integer_type_node),
!        build_decl (FIELD_DECL, NULL_TREE, ptr_type_info),
         NULL);
  
    /* Array, function and enum type_info. No additional fields. */
*************** create_tinfo_types ()
*** 1881,1887 ****
       This is really a descendant of __class_type_info.  */
    si_class_desc_type_node = create_pseudo_type_info
             ("__si_class_type_info", 0,
!             build_lang_decl (FIELD_DECL, NULL_TREE, ptr_type_info),
              NULL);
    
    /* Base class internal helper. Pointer to base type, offset to base,
--- 1881,1887 ----
       This is really a descendant of __class_type_info.  */
    si_class_desc_type_node = create_pseudo_type_info
             ("__si_class_type_info", 0,
!             build_decl (FIELD_DECL, NULL_TREE, ptr_type_info),
              NULL);
    
    /* Base class internal helper. Pointer to base type, offset to base,
*************** create_tinfo_types ()
*** 1889,1896 ****
    {
      tree fields[2];
      
!     fields[0] = build_lang_decl (FIELD_DECL, NULL_TREE, ptr_type_info);
!     fields[1] = build_lang_decl (FIELD_DECL, NULL_TREE, integer_types[itk_long]);
      base_desc_type_node = make_aggr_type (RECORD_TYPE);
      finish_builtin_type (base_desc_type_node, "__base_class_type_info_pseudo",
                           fields, 1, ptr_type_node);
--- 1889,1896 ----
    {
      tree fields[2];
      
!     fields[0] = build_decl (FIELD_DECL, NULL_TREE, ptr_type_info);
!     fields[1] = build_decl (FIELD_DECL, NULL_TREE, integer_types[itk_long]);
      base_desc_type_node = make_aggr_type (RECORD_TYPE);
      finish_builtin_type (base_desc_type_node, "__base_class_type_info_pseudo",
                           fields, 1, ptr_type_node);
*************** create_tinfo_types ()
*** 1905,1913 ****
       This is really a descendant of __pointer_type_info.  */
    ptmd_desc_type_node = create_pseudo_type_info
         ("__pointer_to_member_type_info", 0,
!         build_lang_decl (FIELD_DECL, NULL_TREE, integer_type_node),
!         build_lang_decl (FIELD_DECL, NULL_TREE, ptr_type_info),
!         build_lang_decl (FIELD_DECL, NULL_TREE, ptr_type_info),
          NULL);
  
    pop_nested_namespace (abi_node);
--- 1905,1913 ----
       This is really a descendant of __pointer_type_info.  */
    ptmd_desc_type_node = create_pseudo_type_info
         ("__pointer_to_member_type_info", 0,
!         build_decl (FIELD_DECL, NULL_TREE, integer_type_node),
!         build_decl (FIELD_DECL, NULL_TREE, ptr_type_info),
!         build_decl (FIELD_DECL, NULL_TREE, ptr_type_info),
          NULL);
  
    pop_nested_namespace (abi_node);
Index: typeck.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/typeck.c,v
retrieving revision 1.287
diff -c -p -r1.287 typeck.c
*** typeck.c	2000/05/19 23:06:55	1.287
--- typeck.c	2000/05/24 06:08:26
*************** build_component_ref (datum, component, b
*** 2242,2248 ****
        /* A field is const (volatile) if the enclosing object, or the
  	 field itself, is const (volatile).  But, a mutable field is
  	 not const, even within a const object.  */
!       if (DECL_LANG_SPECIFIC (field) && DECL_MUTABLE_P (field))
  	type_quals &= ~TYPE_QUAL_CONST;
        field_type = cp_build_qualified_type (field_type, type_quals);
      }
--- 2242,2248 ----
        /* A field is const (volatile) if the enclosing object, or the
  	 field itself, is const (volatile).  But, a mutable field is
  	 not const, even within a const object.  */
!       if (DECL_MUTABLE_P (field))
  	type_quals &= ~TYPE_QUAL_CONST;
        field_type = cp_build_qualified_type (field_type, type_quals);
      }

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