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 for cleanup



This patch removes lang_flags in lang_type; it's no longer useful.

And, I've follwed Bernd's lead in the back-end, combining various
global various into a single structure.  This greatly simplifies a
push_cp_function_context and pop_cp_function_context, and makes it
considerably easier to add new "global" variables that must be pushed
and popped in this way.  We also lose some redundant declarations, and
gain a few comments.

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

1999-09-02  Mark Mitchell  <mark@codesourcery.com>

	* cp-tree.h (cp_function): Move here, from decl.c.
	(cp_function_chain): Declare.
	(dtor_label): New macro, instead of variable.
	(ctor_label): Likewise.
	(current_base_init_list): Likewise.
	(current_member_init_list): Likewise.
	(base_init_expr): Likewise.
	(current_class_ptr): Likewise.
	(current_class_ref): Likewise.
	(last_tree): Likewise.
	(last_expr_type): Likewise.
	(current_function_returns_value): Likewise.
	(current_function_returns_null): Likewise.
	(current_function_just_assigned_this): Likewise.
	(current_function_parms_stored): Likewise.
	(temp_name_counter): Likewise.
	(static_labelno): Likewise.
	(expanding_p): Likewise.
	(stmts_are_full_exprs_p): Likewise.
	(in_function_try_handler): Likewise.
	(lang_type): Remove nested type_flags.  All uses changed.
	* call.c (ctor_label): Remove.
	(dtor_label): Likewise.
	* class.c (current_class_ptr): Remove.
	(current_class_ref): Likewise.
	* decl.c (static_labelno): Remove.
	(dtor_label): Likewise.
	(last_dtor_insn): New macro, instead of variable.
	(last_parm_cleanup_insn): Likewise.
	(original_result_rtx): Likewise.
	(in_function_try_handler): Remove.
	(named_label_uses): New macro, instead of variable.
	(named_labels): Likewise.
	(current_function_returns_value): Remove.
	(current_function_returns_null): Likewise.
	(current_function_assigns_this): New macro, instead of variable.
	(current_function_just_assigned_this): Likewise.
	(current_binding_level): Likewise.
	(init_decl_processing): Call push_cp_function_context.
	(cp_function): Move to cp-tree.h
	(cp_function_chain): Make it global.
	(temp_name_counter): Remove.
	(push_cp_function_context): Simplify.
	(pop_cp_function_context): Likewise.
	* decl2.c (temp_name_counter): Remove.
	* init_c (current_base_init_list): Likewise.
	(current_member_init_list): Likewise.
	(base_init_expr): Likewise.
	* method.c (static_labelno): Likewise.
	* pt.c (last_tree): Likewise.
	* semantics.c (expanding_p): Likewise.
	(stmts_are_full_exprs_p): Likewise.
	(last_expr_type): Likewise.
	* typeck.c (dtor_label): Likewise.
	(ctor_label): Likewise.
	
Index: cp-tree.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/cp-tree.h,v
retrieving revision 1.281
diff -c -p -r1.281 cp-tree.h
*** cp-tree.h	1999/09/01 21:56:37	1.281
--- cp-tree.h	1999/09/02 19:00:05
*************** extern tree cp_global_trees[CPTI_MAX];
*** 432,441 ****
  #define abort_fndecl			cp_global_trees[CPTI_ABORT_FNDECL]
  #define global_delete_fndecl		cp_global_trees[CPTI_GLOBAL_DELETE_FNDECL]
  
! extern int current_function_returns_value;
! extern int current_function_returns_null;
! extern tree current_function_return_value;
  
  extern tree current_namespace;
  extern tree global_namespace;
  
--- 432,569 ----
  #define abort_fndecl			cp_global_trees[CPTI_ABORT_FNDECL]
  #define global_delete_fndecl		cp_global_trees[CPTI_GLOBAL_DELETE_FNDECL]
  
! /* Global state pertinent to the current function.  */
! 
! struct cp_function
! {
!   tree named_labels;
!   tree ctor_label;
!   tree dtor_label;
!   tree base_init_list;
!   tree member_init_list;
!   tree base_init_expr;
!   tree current_class_ptr;
!   tree current_class_ref;
!   tree last_tree;
!   tree last_expr_type;
! 
!   struct rtx_def *last_dtor_insn;
!   struct rtx_def *last_parm_cleanup_insn;
!   struct rtx_def *result_rtx;
! 
!   int returns_value;
!   int returns_null;
!   int assigns_this;
!   int just_assigned_this;
!   int parms_stored;
!   int temp_name_counter;
!   int static_labelno;
!   int in_function_try_handler;
!   int expanding_p;
!   int stmts_are_full_exprs_p; 
! 
!   struct named_label_list *named_label_uses;
!   struct binding_level *binding_level;
! 
!   struct cp_function *next;
! };
! 
! /* A stack of cp_functions.  The head is the one that is used for all
!    the per-function globals.  */
! 
! extern struct cp_function *cp_function_chain;
! 
! /* In a destructor, the point at which all derived class destroying
!    has been done, just before any base class destroying will be done.  */
! 
! #define dtor_label cp_function_chain->dtor_label
! 
! /* In a constructor, the point at which we are ready to return
!    the pointer to the initialized object.  */
! 
! #define ctor_label cp_function_chain->ctor_label
! 
! /* In C++, structures with well-defined constructors are initialized by
!    those constructors, unasked.  CURRENT_BASE_INIT_LIST
!    holds a list of stmts for a BASE_INIT term in the grammar.
!    This list has one element for each base class which must be
!    initialized.  The list elements are [basename, init], with
!    type basetype.  This allows the possibly anachronistic form
!    (assuming d : a, b, c) "d (int a) : c(a+5), b (a-4), a (a+3)"
!    where each successive term can be handed down the constructor
!    line.  Perhaps this was not intended.  */
! 
! #define current_base_init_list cp_function_chain->base_init_list
! #define current_member_init_list cp_function_chain->member_init_list
! 
! /* Sequence of insns which represents base initialization.  */
! 
! #define base_init_expr cp_function_chain->base_init_expr
! 
! /* When we're processing a member function, current_class_ptr is the
!    PARM_DECL for the `this' pointer.  The current_class_ref is an
!    expression for `*this'.  */
! 
! #define current_class_ptr cp_function_chain->current_class_ptr
! #define current_class_ref cp_function_chain->current_class_ref
! 
! /* When building a statement-tree, this is the last node added to the
!    tree.  */
! 
! #define last_tree cp_function_chain->last_tree
! 
! /* The type of the last expression-statement we have seen.  This is
!    required because the type of a statement-expression is the type of
!    the last expression statement.  */
  
+ #define last_expr_type cp_function_chain->last_expr_type
+ 
+ /* Set to 0 at beginning of a function definition, set to 1 if
+    a return statement that specifies a return value is seen.  */
+ 
+ #define current_function_returns_value cp_function_chain->returns_value
+ 
+ /* Set to 0 at beginning of a function definition, set to 1 if
+    a return statement with no argument is seen.  */
+ 
+ #define current_function_returns_null cp_function_chain->returns_null
+ 
+ #define current_function_just_assigned_this \
+   cp_function_chain->just_assigned_this
+ 
+ #define current_function_parms_stored \
+   cp_function_chain->parms_stored
+ 
+ /* Used to help generate temporary names which are unique within
+    a function.  Reset to 0 by start_function.  */
+ 
+ #define temp_name_counter cp_function_chain->temp_name_counter
+ 
+ #define static_labelno cp_function_chain->static_labelno
+ 
+ /* Non-zero if we should generate RTL for functions that we process.
+    When this is zero, we just accumulate tree structure, without
+    interacting with the back end.  */
+ 
+ #define expanding_p cp_function_chain->expanding_p
+ 
+ /* Non-zero if we should treat statements as full expressions.  In
+    particular, this variable is no-zero if at the end of a statement
+    we should destroy any temporaries created during that statement.
+    Similarly, if, at the end of a block, we should destroy any local
+    variables in this block.  Normally, this variable is non-zero,
+    since those are the normal semantics of C++.
+ 
+    However, in order to represent aggregate initialization code as
+    tree structure, we use statement-expressions.  The statements
+    within the statement expression should not result in cleanups being
+    run until the entire enclosing statement is complete.  */
+ 
+ #define stmts_are_full_exprs_p cp_function_chain->stmts_are_full_exprs_p
+ 
+ #define in_function_try_handler cp_function_chain->in_function_try_handler
+ 
+ extern tree current_function_return_value;
  extern tree current_namespace;
  extern tree global_namespace;
  
*************** enum languages { lang_c, lang_cplusplus,
*** 753,819 ****
     a minimum.  */
  struct lang_type
  {
!   struct
!     {
!       unsigned has_type_conversion : 1;
!       unsigned has_init_ref : 1;
!       unsigned has_default_ctor : 1;
!       unsigned uses_multiple_inheritance : 1;
!       unsigned const_needs_init : 1;
!       unsigned ref_needs_init : 1;
!       unsigned has_const_assign_ref : 1;
!       unsigned anon_aggr : 1;
! 
!       unsigned has_nonpublic_ctor : 2;
!       unsigned has_nonpublic_assign_ref : 2;
!       unsigned vtable_needs_writing : 1;
!       unsigned has_assign_ref : 1;
!       unsigned gets_new : 2;
! 
!       unsigned gets_delete : 2;
!       unsigned has_call_overloaded : 1;
!       unsigned has_array_ref_overloaded : 1;
!       unsigned has_arrow_overloaded : 1;
!       unsigned interface_only : 1;
!       unsigned interface_unknown : 1;
!       unsigned needs_virtual_reinit : 1;
! 
!       unsigned marks: 6;
!       unsigned vec_delete_takes_size : 1;
!       unsigned declared_class : 1;
! 
!       unsigned being_defined : 1;
!       unsigned redefined : 1;
!       unsigned debug_requested : 1;
!       unsigned use_template : 2;
!       unsigned got_semicolon : 1;
!       unsigned ptrmemfunc_flag : 1;
!       unsigned was_anonymous : 1;
! 
!       unsigned has_real_assign_ref : 1;
!       unsigned has_const_init_ref : 1;
!       unsigned has_complex_init_ref : 1;
!       unsigned has_complex_assign_ref : 1;
!       unsigned has_abstract_assign_ref : 1;
!       unsigned non_aggregate : 1;
!       unsigned is_partial_instantiation : 1;
!       unsigned has_mutable : 1;
! 
!       unsigned com_interface : 1;
!       unsigned non_pod_class : 1;
! 
!       /* When adding a flag here, consider whether or not it ought to
! 	 apply to a template instance if it applies to the template.
! 	 If so, make sure to copy it in instantiate_class_template!  */
! 
!       /* The MIPS compiler gets it wrong if this struct also
! 	 does not fill out to a multiple of 4 bytes.  Add a
! 	 member `dummy' with new bits if you go over the edge.  */
!       unsigned dummy : 6;
!       
!       unsigned char align;
!     } type_flags;
  
    int vsize;
    int vfield_parent;
  
--- 881,944 ----
     a minimum.  */
  struct lang_type
  {
!   unsigned char align;
  
+   unsigned has_type_conversion : 1;
+   unsigned has_init_ref : 1;
+   unsigned has_default_ctor : 1;
+   unsigned uses_multiple_inheritance : 1;
+   unsigned const_needs_init : 1;
+   unsigned ref_needs_init : 1;
+   unsigned has_const_assign_ref : 1;
+   unsigned anon_aggr : 1;
+ 
+   unsigned has_nonpublic_ctor : 2;
+   unsigned has_nonpublic_assign_ref : 2;
+   unsigned vtable_needs_writing : 1;
+   unsigned has_assign_ref : 1;
+   unsigned gets_new : 2;
+ 
+   unsigned gets_delete : 2;
+   unsigned has_call_overloaded : 1;
+   unsigned has_array_ref_overloaded : 1;
+   unsigned has_arrow_overloaded : 1;
+   unsigned interface_only : 1;
+   unsigned interface_unknown : 1;
+   unsigned needs_virtual_reinit : 1;
+ 
+   unsigned marks: 6;
+   unsigned vec_delete_takes_size : 1;
+   unsigned declared_class : 1;
+ 
+   unsigned being_defined : 1;
+   unsigned redefined : 1;
+   unsigned debug_requested : 1;
+   unsigned use_template : 2;
+   unsigned got_semicolon : 1;
+   unsigned ptrmemfunc_flag : 1;
+   unsigned was_anonymous : 1;
+ 
+   unsigned has_real_assign_ref : 1;
+   unsigned has_const_init_ref : 1;
+   unsigned has_complex_init_ref : 1;
+   unsigned has_complex_assign_ref : 1;
+   unsigned has_abstract_assign_ref : 1;
+   unsigned non_aggregate : 1;
+   unsigned is_partial_instantiation : 1;
+   unsigned has_mutable : 1;
+ 
+   unsigned com_interface : 1;
+   unsigned non_pod_class : 1;
+ 
+   /* When adding a flag here, consider whether or not it ought to
+      apply to a template instance if it applies to the template.  If
+      so, make sure to copy it in instantiate_class_template!  */
+ 
+   /* There are six bits left to fill out a 32-bit word.  Keep track of
+      this by updating the size of this bitfield whenever you add or
+      remove a flag.  */
+   unsigned dummy : 6;
+       
    int vsize;
    int vfield_parent;
  
*************** struct lang_type
*** 842,848 ****
       1=implicit template instantiation
       2=explicit template specialization
       3=explicit template instantiation  */
! #define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.use_template)
  
  /* Fields used for storing information before the class is defined.
     After the class is defined, these fields hold other information.  */
--- 967,973 ----
       1=implicit template instantiation
       2=explicit template specialization
       3=explicit template instantiation  */
! #define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC(NODE)->use_template)
  
  /* Fields used for storing information before the class is defined.
     After the class is defined, these fields hold other information.  */
*************** struct lang_type
*** 852,904 ****
  
  /* Nonzero for _CLASSTYPE means that operator new and delete are defined,
     respectively.  */
! #define TYPE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_new)
! #define TYPE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_delete)
  #define TYPE_GETS_REG_DELETE(NODE) (TYPE_GETS_DELETE (NODE) & 1)
  
  /* Nonzero for _CLASSTYPE means that operator vec delete is defined and
     takes the optional size_t argument.  */
  #define TYPE_VEC_DELETE_TAKES_SIZE(NODE) \
!   (TYPE_LANG_SPECIFIC(NODE)->type_flags.vec_delete_takes_size)
  #define TYPE_VEC_NEW_USES_COOKIE(NODE) \
    (TYPE_NEEDS_DESTRUCTOR (NODE) \
     || (TYPE_LANG_SPECIFIC (NODE) && TYPE_VEC_DELETE_TAKES_SIZE (NODE)))
  
  /* Nonzero means that this _CLASSTYPE node defines ways of converting
     itself to other types.  */
! #define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_type_conversion)
  
  /* Nonzero means that this _CLASSTYPE node overloads operator=(X&).  */
! #define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assign_ref)
! #define TYPE_HAS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_assign_ref)
  
  /* Nonzero means that this _CLASSTYPE node has an X(X&) constructor.  */
! #define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_init_ref)
! #define TYPE_HAS_CONST_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_init_ref)
  
  /* Nonzero means that this type is being defined.  I.e., the left brace
     starting the definition of this type has been seen.  */
! #define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.being_defined)
  /* Nonzero means that this type has been redefined.  In this case, if
     convenient, don't reprocess any methods that appear in its redefinition.  */
! #define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.redefined)
  
  /* 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().  */
! #define TYPE_OVERLOADS_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_call_overloaded)
  
  /* Nonzero means that this _CLASSTYPE node overloads operator[].  */
! #define TYPE_OVERLOADS_ARRAY_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_array_ref_overloaded)
  
  /* Nonzero means that this _CLASSTYPE node overloads operator->.  */
! #define TYPE_OVERLOADS_ARROW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_arrow_overloaded)
  
  /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
     multiple inheritance.  If this is 0 for the root of a type
     hierarchy, then we can use more efficient search techniques.  */
! #define TYPE_USES_MULTIPLE_INHERITANCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.uses_multiple_inheritance)
  
  /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
     virtual base classes.  If this is 0 for the root of a type
--- 977,1029 ----
  
  /* Nonzero for _CLASSTYPE means that operator new and delete are defined,
     respectively.  */
! #define TYPE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->gets_new)
! #define TYPE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->gets_delete)
  #define TYPE_GETS_REG_DELETE(NODE) (TYPE_GETS_DELETE (NODE) & 1)
  
  /* Nonzero for _CLASSTYPE means that operator vec delete is defined and
     takes the optional size_t argument.  */
  #define TYPE_VEC_DELETE_TAKES_SIZE(NODE) \
!   (TYPE_LANG_SPECIFIC(NODE)->vec_delete_takes_size)
  #define TYPE_VEC_NEW_USES_COOKIE(NODE) \
    (TYPE_NEEDS_DESTRUCTOR (NODE) \
     || (TYPE_LANG_SPECIFIC (NODE) && TYPE_VEC_DELETE_TAKES_SIZE (NODE)))
  
  /* Nonzero means that this _CLASSTYPE node defines ways of converting
     itself to other types.  */
! #define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_type_conversion)
  
  /* Nonzero means that this _CLASSTYPE node overloads operator=(X&).  */
! #define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_assign_ref)
! #define TYPE_HAS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_const_assign_ref)
  
  /* Nonzero means that this _CLASSTYPE node has an X(X&) constructor.  */
! #define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_init_ref)
! #define TYPE_HAS_CONST_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_const_init_ref)
  
  /* Nonzero means that this type is being defined.  I.e., the left brace
     starting the definition of this type has been seen.  */
! #define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->being_defined)
  /* Nonzero means that this type has been redefined.  In this case, if
     convenient, don't reprocess any methods that appear in its redefinition.  */
! #define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->redefined)
  
  /* 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().  */
! #define TYPE_OVERLOADS_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_call_overloaded)
  
  /* Nonzero means that this _CLASSTYPE node overloads operator[].  */
! #define TYPE_OVERLOADS_ARRAY_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_array_ref_overloaded)
  
  /* Nonzero means that this _CLASSTYPE node overloads operator->.  */
! #define TYPE_OVERLOADS_ARROW(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_arrow_overloaded)
  
  /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
     multiple inheritance.  If this is 0 for the root of a type
     hierarchy, then we can use more efficient search techniques.  */
! #define TYPE_USES_MULTIPLE_INHERITANCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->uses_multiple_inheritance)
  
  /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
     virtual base classes.  If this is 0 for the root of a type
*************** struct lang_type
*** 925,943 ****
  
  /* Get the value of the Nth mark bit.  */
  #define CLASSTYPE_MARKED_N(NODE, N)					\
!   (((CLASS_TYPE_P (NODE) ? TYPE_LANG_SPECIFIC (NODE)->type_flags.marks	\
       : TYPE_ALIAS_SET (NODE)) & (1 << N)) != 0)
  
  /* Set the Nth mark bit.  */
  #define SET_CLASSTYPE_MARKED_N(NODE, N)					\
    (CLASS_TYPE_P (NODE)							\
!    ? (TYPE_LANG_SPECIFIC (NODE)->type_flags.marks |= (1 << (N)))	\
     : (TYPE_ALIAS_SET (NODE) |= (1 << (N))))
  
  /* Clear the Nth mark bit.  */
  #define CLEAR_CLASSTYPE_MARKED_N(NODE, N)				\
    (CLASS_TYPE_P (NODE)							\
!    ? (TYPE_LANG_SPECIFIC (NODE)->type_flags.marks &= ~(1 << (N)))	\
     : (TYPE_ALIAS_SET (NODE) &= ~(1 << (N))))
  
  /* Get the value of the mark bits.  */
--- 1050,1068 ----
  
  /* Get the value of the Nth mark bit.  */
  #define CLASSTYPE_MARKED_N(NODE, N)					\
!   (((CLASS_TYPE_P (NODE) ? TYPE_LANG_SPECIFIC (NODE)->marks	\
       : TYPE_ALIAS_SET (NODE)) & (1 << N)) != 0)
  
  /* Set the Nth mark bit.  */
  #define SET_CLASSTYPE_MARKED_N(NODE, N)					\
    (CLASS_TYPE_P (NODE)							\
!    ? (TYPE_LANG_SPECIFIC (NODE)->marks |= (1 << (N)))	\
     : (TYPE_ALIAS_SET (NODE) |= (1 << (N))))
  
  /* Clear the Nth mark bit.  */
  #define CLEAR_CLASSTYPE_MARKED_N(NODE, N)				\
    (CLASS_TYPE_P (NODE)							\
!    ? (TYPE_LANG_SPECIFIC (NODE)->marks &= ~(1 << (N)))	\
     : (TYPE_ALIAS_SET (NODE) &= ~(1 << (N))))
  
  /* Get the value of the mark bits.  */
*************** struct lang_type
*** 998,1004 ****
  /* These are the size, mode and alignment of the type without its
     virtual base classes, for when we use this type as a base itself.  */
  #define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size)
! #define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.align)
  
  /* A cons list of virtual functions which cannot be inherited by
     derived classes.  When deriving from this type, the derived
--- 1123,1129 ----
  /* These are the size, mode and alignment of the type without its
     virtual base classes, for when we use this type as a base itself.  */
  #define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size)
! #define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->align)
  
  /* A cons list of virtual functions which cannot be inherited by
     derived classes.  When deriving from this type, the derived
*************** struct lang_type
*** 1006,1044 ****
  #define CLASSTYPE_ABSTRACT_VIRTUALS(NODE) (TYPE_LANG_SPECIFIC(NODE)->abstract_virtuals)
  
  /* Nonzero means that this aggr type has been `closed' by a semicolon.  */
! #define CLASSTYPE_GOT_SEMICOLON(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.got_semicolon)
  
  /* Nonzero means that the main virtual function table pointer needs to be
     set because base constructors have placed the wrong value there.
     If this is zero, it means that they placed the right value there,
     and there is no need to change it.  */
! #define CLASSTYPE_NEEDS_VIRTUAL_REINIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.needs_virtual_reinit)
  
  /* Nonzero means that if this type has virtual functions, that
     the virtual function table will be written out.  */
! #define CLASSTYPE_VTABLE_NEEDS_WRITING(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.vtable_needs_writing)
  
  /* Nonzero means that this type has an X() constructor.  */
! #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_default_ctor)
  
  /* Nonzero means the type declared a ctor as private or protected.  We
     use this to make sure we don't try to generate a copy ctor for a 
     class that has a member of type NODE.  */
! #define TYPE_HAS_NONPUBLIC_CTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_nonpublic_ctor)
  
  /* Ditto, for operator=.  */
! #define TYPE_HAS_NONPUBLIC_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_nonpublic_assign_ref)
  
  /* Nonzero means that this type contains a mutable member */
! #define CLASSTYPE_HAS_MUTABLE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_mutable)
  #define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE))
  
  /*  Nonzero means that this class type is a non-POD class.  */
! #define CLASSTYPE_NON_POD_P(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.non_pod_class)
  
  /* Nonzero means that this type is meant for communication via COM.  */
  #define CLASSTYPE_COM_INTERFACE(NODE) \
!   (TYPE_LANG_SPECIFIC(NODE)->type_flags.com_interface)
  
  /* 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
--- 1131,1169 ----
  #define CLASSTYPE_ABSTRACT_VIRTUALS(NODE) (TYPE_LANG_SPECIFIC(NODE)->abstract_virtuals)
  
  /* Nonzero means that this aggr type has been `closed' by a semicolon.  */
! #define CLASSTYPE_GOT_SEMICOLON(NODE) (TYPE_LANG_SPECIFIC (NODE)->got_semicolon)
  
  /* Nonzero means that the main virtual function table pointer needs to be
     set because base constructors have placed the wrong value there.
     If this is zero, it means that they placed the right value there,
     and there is no need to change it.  */
! #define CLASSTYPE_NEEDS_VIRTUAL_REINIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->needs_virtual_reinit)
  
  /* Nonzero means that if this type has virtual functions, that
     the virtual function table will be written out.  */
! #define CLASSTYPE_VTABLE_NEEDS_WRITING(NODE) (TYPE_LANG_SPECIFIC(NODE)->vtable_needs_writing)
  
  /* Nonzero means that this type has an X() constructor.  */
! #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_default_ctor)
  
  /* Nonzero means the type declared a ctor as private or protected.  We
     use this to make sure we don't try to generate a copy ctor for a 
     class that has a member of type NODE.  */
! #define TYPE_HAS_NONPUBLIC_CTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_nonpublic_ctor)
  
  /* Ditto, for operator=.  */
! #define TYPE_HAS_NONPUBLIC_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_nonpublic_assign_ref)
  
  /* Nonzero means that this type contains a mutable member */
! #define CLASSTYPE_HAS_MUTABLE(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_mutable)
  #define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE))
  
  /*  Nonzero means that this class type is a non-POD class.  */
! #define CLASSTYPE_NON_POD_P(NODE) (TYPE_LANG_SPECIFIC (NODE)->non_pod_class)
  
  /* Nonzero means that this type is meant for communication via COM.  */
  #define CLASSTYPE_COM_INTERFACE(NODE) \
!   (TYPE_LANG_SPECIFIC(NODE)->com_interface)
  
  /* 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
*************** struct lang_type
*** 1050,1076 ****
    (TYPE_LANG_SPECIFIC (NODE)->befriending_classes)
  
  /* Say whether this node was declared as a "class" or a "struct".  */
! #define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.declared_class)
  
  /* Nonzero if this class has const members which have no specified initialization.  */
! #define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.const_needs_init)
  
  /* Nonzero if this class has ref members which have no specified initialization.  */
! #define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.ref_needs_init)
  
  /* Nonzero if this class is included from a header file which employs
     `#pragma interface', and it is not included in its implementation file.  */
! #define CLASSTYPE_INTERFACE_ONLY(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_only)
  
  /* Same as above, but for classes whose purpose we do not know.  */
! #define CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown)
! #define CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown == 0)
! #define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = !!(X))
! #define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 1)
! #define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.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)->type_flags.debug_requested)
  
  /* Additional macros for inheritance information.  */
  
--- 1175,1201 ----
    (TYPE_LANG_SPECIFIC (NODE)->befriending_classes)
  
  /* Say whether this node was declared as a "class" or a "struct".  */
! #define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->declared_class)
  
  /* Nonzero if this class has const members which have no specified initialization.  */
! #define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->const_needs_init)
  
  /* Nonzero if this class has ref members which have no specified initialization.  */
! #define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->ref_needs_init)
  
  /* Nonzero if this class is included from a header file which employs
     `#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)
  
  /* Additional macros for inheritance information.  */
  
*************** extern int flag_new_for_scope;
*** 1692,1706 ****
  /* Nonzero means that an object of this type can not be initialized using
     an initializer list.  */
  #define CLASSTYPE_NON_AGGREGATE(NODE) \
!   (TYPE_LANG_SPECIFIC (NODE)->type_flags.non_aggregate)
  #define TYPE_NON_AGGREGATE_CLASS(NODE) \
    (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE))
  
  /* Nonzero if there is a user-defined X::op=(x&) for this class.  */
! #define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_real_assign_ref)
! #define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_assign_ref)
! #define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_abstract_assign_ref)
! #define TYPE_HAS_COMPLEX_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_init_ref)
  
  /* Nonzero for _TYPE node means that destroying an object of this type
     will involve a call to a destructor.  This can apply to objects
--- 1817,1831 ----
  /* Nonzero means that an object of this type can not be initialized using
     an initializer list.  */
  #define CLASSTYPE_NON_AGGREGATE(NODE) \
!   (TYPE_LANG_SPECIFIC (NODE)->non_aggregate)
  #define TYPE_NON_AGGREGATE_CLASS(NODE) \
    (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE))
  
  /* Nonzero if there is a user-defined X::op=(x&) for this class.  */
! #define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_real_assign_ref)
! #define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_complex_assign_ref)
! #define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_abstract_assign_ref)
! #define TYPE_HAS_COMPLEX_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_complex_init_ref)
  
  /* Nonzero for _TYPE node means that destroying an object of this type
     will involve a call to a destructor.  This can apply to objects
*************** extern int flag_new_for_scope;
*** 1740,1746 ****
     && TYPE_PTRMEMFUNC_FLAG (NODE))
  
  #define TYPE_PTRMEMFUNC_FLAG(NODE) \
!   (TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag)
  
  /* A pointer-to-function member type looks like:
  
--- 1865,1871 ----
     && TYPE_PTRMEMFUNC_FLAG (NODE))
  
  #define TYPE_PTRMEMFUNC_FLAG(NODE) \
!   (TYPE_LANG_SPECIFIC(NODE)->ptrmemfunc_flag)
  
  /* A pointer-to-function member type looks like:
  
*************** extern int flag_new_for_scope;
*** 1848,1856 ****
     flag for this because "A union for which objects or pointers are
     declared is not an anonymous union" [class.union].  */
  #define ANON_AGGR_TYPE_P(NODE)				\
!   (CLASS_TYPE_P (NODE) && TYPE_LANG_SPECIFIC (NODE)->type_flags.anon_aggr)
  #define SET_ANON_AGGR_TYPE_P(NODE)			\
!   (TYPE_LANG_SPECIFIC (NODE)->type_flags.anon_aggr = 1)
  
  #define UNKNOWN_TYPE LANG_TYPE
  
--- 1973,1981 ----
     flag for this because "A union for which objects or pointers are
     declared is not an anonymous union" [class.union].  */
  #define ANON_AGGR_TYPE_P(NODE)				\
!   (CLASS_TYPE_P (NODE) && TYPE_LANG_SPECIFIC (NODE)->anon_aggr)
  #define SET_ANON_AGGR_TYPE_P(NODE)			\
!   (TYPE_LANG_SPECIFIC (NODE)->anon_aggr = 1)
  
  #define UNKNOWN_TYPE LANG_TYPE
  
*************** extern int flag_new_for_scope;
*** 1868,1874 ****
  #define DECL_VPARENT(NODE) ((NODE)->decl.arguments)
  #endif
  
! #define TYPE_WAS_ANONYMOUS(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.was_anonymous)
  
  /* C++: all of these are overloaded!  These apply only to TYPE_DECLs.  */
  
--- 1993,1999 ----
  #define DECL_VPARENT(NODE) ((NODE)->decl.arguments)
  #endif
  
! #define TYPE_WAS_ANONYMOUS(NODE) (TYPE_LANG_SPECIFIC (NODE)->was_anonymous)
  
  /* C++: all of these are overloaded!  These apply only to TYPE_DECLs.  */
  
*************** extern int flag_new_for_scope;
*** 2072,2078 ****
     i.e., an instantiation whose instantiation arguments involve
     template types.  */
  #define PARTIAL_INSTANTIATION_P(TYPE) \
!   (TYPE_LANG_SPECIFIC (TYPE)->type_flags.is_partial_instantiation)
  
  /* Non-zero iff we are currently processing a declaration for an
     entity with its own template parameter list, and which is not a
--- 2197,2203 ----
     i.e., an instantiation whose instantiation arguments involve
     template types.  */
  #define PARTIAL_INSTANTIATION_P(TYPE) \
!   (TYPE_LANG_SPECIFIC (TYPE)->is_partial_instantiation)
  
  /* Non-zero iff we are currently processing a declaration for an
     entity with its own template parameter list, and which is not a
*************** extern tree tag_identifier;
*** 2265,2272 ****
  extern tree vt_off_identifier;
  extern tree empty_except_spec;
  
- extern int in_function_try_handler;
- 
  /* A node that is a list (length 1) of error_mark_nodes.  */
  extern tree error_mark_list;
  
--- 2390,2395 ----
*************** typedef enum unification_kind_t {
*** 2297,2303 ****
  
  extern tree current_template_parms;
  extern HOST_WIDE_INT processing_template_decl;
- extern tree last_tree;
  
  /* The template currently being instantiated, and where the instantiation
     was triggered.  */
--- 2420,2425 ----
*************** extern tree current_access_specifier;
*** 2321,2329 ****
  
  extern tree current_class_name;
  extern tree current_class_type;
- extern tree current_class_ptr;
  extern tree previous_class_type;
- extern tree current_class_ref;
  extern int current_class_depth;
  
  extern tree current_lang_name;
--- 2443,2449 ----
*************** extern tree original_function_name;
*** 2338,2347 ****
  
  /* in init.c  */
  extern tree global_base_init_list;
- extern tree current_base_init_list, current_member_init_list;
  
- extern int current_function_just_assigned_this;
- extern int current_function_parms_stored;
  
  /* Here's where we control how name mangling takes place.  */
  
--- 2458,2464 ----
*************** extern tree expand_stmt                 
*** 3402,3410 ****
  extern void expand_body                         PROTO((tree));
  extern void begin_stmt_tree                     PROTO((tree));
  extern void finish_stmt_tree                    PROTO((tree));
- extern int expanding_p;
- extern int stmts_are_full_exprs_p;
- extern tree last_expr_type;
  /* Non-zero if we are presently building a statement tree, rather
     than expanding each statement as we encounter it.  */
  #define building_stmt_tree() \
--- 3519,3524 ----
Index: call.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/call.c,v
retrieving revision 1.165
diff -c -p -r1.165 call.c
*** call.c	1999/09/01 21:56:38	1.165
--- call.c	1999/09/02 18:59:58
*************** Boston, MA 02111-1307, USA.  */
*** 38,44 ****
  #define obstack_chunk_free free
  
  extern int inhibit_warnings;
- extern tree ctor_label, dtor_label;
  
  static tree build_new_method_call PROTO((tree, tree, tree, tree, int));
  
--- 38,43 ----
Index: class.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/class.c,v
retrieving revision 1.180
diff -c -p -r1.180 class.c
*** class.c	1999/08/18 20:44:06	1.180
--- class.c	1999/09/02 19:00:02
*************** typedef struct class_stack_node {
*** 71,81 ****
  static int current_class_stack_size;
  static class_stack_node_t current_class_stack;
  
- /* When we're processing a member function, current_class_ptr is the
-    PARM_DECL for the `this' pointer.  The current_class_ref is an
-    expression for `*this'.  */
- tree current_class_ptr, current_class_ref;
- 
  /* The following two can be derived from the previous one */
  tree current_class_name;	/* IDENTIFIER_NODE: name of current class */
  tree current_class_type;	/* _TYPE: the type of the current class */
--- 71,76 ----
Index: decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.422
diff -c -p -r1.422 decl.c
*** decl.c	1999/08/30 15:50:27	1.422
--- decl.c	1999/09/02 19:00:14
*************** extern int current_class_depth;
*** 55,62 ****
  
  extern tree static_ctors, static_dtors;
  
- extern int static_labelno;
- 
  extern tree current_namespace;
  extern tree global_namespace;
  
--- 55,60 ----
*************** int in_std;
*** 300,335 ****
  /* Expect only namespace names now. */
  static int only_namespace_names;
  
- /* In a destructor, the point at which all derived class destroying
-    has been done, just before any base class destroying will be done.  */
- 
- tree dtor_label;
- 
  /* In a destructor, the last insn emitted after the start of the
     function and the parms.  */
  
! static rtx last_dtor_insn;
  
  /* In a constructor, the last insn emitted after the start of the
     function and the parms, the exception specification and any
     function-try-block.  The constructor initializers are emitted after
     this insn.  */
  
! static rtx last_parm_cleanup_insn;
  
- /* In a constructor, the point at which we are ready to return
-    the pointer to the initialized object.  */
- 
- tree ctor_label;
- 
  /* If original DECL_RESULT of current function was a register,
     but due to being an addressable named return value, would up
     on the stack, this variable holds the named return value's
     original location.  */
- static rtx original_result_rtx;
  
! /* Sequence of insns which represents base initialization.  */
! tree base_init_expr;
  
  /* C++: Keep these around to reduce calls to `get_identifier'.
     Identifiers for `this' in member functions and the auto-delete
--- 298,321 ----
  /* Expect only namespace names now. */
  static int only_namespace_names;
  
  /* In a destructor, the last insn emitted after the start of the
     function and the parms.  */
  
! #define last_dtor_insn cp_function_chain->last_dtor_insn
  
  /* In a constructor, the last insn emitted after the start of the
     function and the parms, the exception specification and any
     function-try-block.  The constructor initializers are emitted after
     this insn.  */
  
! #define last_parm_cleanup_insn cp_function_chain->last_parm_cleanup_insn
  
  /* If original DECL_RESULT of current function was a register,
     but due to being an addressable named return value, would up
     on the stack, this variable holds the named return value's
     original location.  */
  
! #define original_result_rtx cp_function_chain->result_rtx
  
  /* C++: Keep these around to reduce calls to `get_identifier'.
     Identifiers for `this' in member functions and the auto-delete
*************** tree vt_off_identifier;
*** 344,352 ****
  /* Exception specifier used for throw().  */
  tree empty_except_spec;
  
- /* Nonzero if we're in a handler for a function-try-block.  */
- int in_function_try_handler;
- 
  struct named_label_list
  {
    struct binding_level *binding_level;
--- 330,335 ----
*************** struct named_label_list
*** 374,380 ****
     jumps to defined labels can have their validity checked
     by stmt.c.  */
  
! static struct named_label_list *named_label_uses = NULL;
  
  /* A list of objects which have constructors or destructors
     which reside in the global scope.  The decl is stored in
--- 357,363 ----
     jumps to defined labels can have their validity checked
     by stmt.c.  */
  
! #define named_label_uses cp_function_chain->named_label_uses
  
  /* A list of objects which have constructors or destructors
     which reside in the global scope.  The decl is stored in
*************** static tree current_function_parm_tags;
*** 431,452 ****
     at the end of the function.  The TREE_VALUE is a LABEL_DECL; the
     TREE_PURPOSE is the previous binding of the label.  */
  
! static tree named_labels;
  
  /* The FUNCTION_DECL for the function currently being compiled,
     or 0 if between functions.  */
  tree current_function_decl;
  
- /* Set to 0 at beginning of a function definition, set to 1 if
-    a return statement that specifies a return value is seen.  */
- 
- int current_function_returns_value;
- 
- /* Set to 0 at beginning of a function definition, set to 1 if
-    a return statement with no argument is seen.  */
- 
- int current_function_returns_null;
- 
  /* Set to 0 at beginning of a function definition, and whenever
     a label (case or named) is defined.  Set to value of expression
     returned from function when that value can be transformed into
--- 414,425 ----
     at the end of the function.  The TREE_VALUE is a LABEL_DECL; the
     TREE_PURPOSE is the previous binding of the label.  */
  
! #define named_labels cp_function_chain->named_labels
  
  /* The FUNCTION_DECL for the function currently being compiled,
     or 0 if between functions.  */
  tree current_function_decl;
  
  /* Set to 0 at beginning of a function definition, and whenever
     a label (case or named) is defined.  Set to value of expression
     returned from function when that value can be transformed into
*************** extern tree *current_lang_base, *current
*** 491,503 ****
  /* Set to 0 at beginning of a constructor, set to 1
     if that function does an allocation before referencing its
     instance variable.  */
! static int current_function_assigns_this;
! int current_function_just_assigned_this;
! 
! /* Set to 0 at beginning of a function.  Set non-zero when
!    store_parm_decls is called.  Don't call store_parm_decls
!    if this flag is non-zero!  */
! int current_function_parms_stored;
  
  /* Flag used when debugging spew.c */
  
--- 464,472 ----
  /* Set to 0 at beginning of a constructor, set to 1
     if that function does an allocation before referencing its
     instance variable.  */
! #define current_function_assigns_this cp_function_chain->assigns_this
! #define current_function_just_assigned_this \
!   cp_function_chain->just_assigned_this
  
  /* Flag used when debugging spew.c */
  
*************** struct binding_level
*** 664,670 ****
    
  /* The binding level currently in effect.  */
  
! static struct binding_level *current_binding_level;
  
  /* The binding level of the current class, if any.  */
  
--- 633,639 ----
    
  /* The binding level currently in effect.  */
  
! #define current_binding_level cp_function_chain->binding_level
  
  /* The binding level of the current class, if any.  */
  
*************** init_decl_processing ()
*** 6204,6209 ****
--- 6173,6181 ----
    lang_name_c = get_identifier ("C");
    lang_name_java = get_identifier ("Java");
  
+   /* Create the global per-function variables.  */
+   push_cp_function_context (NULL_TREE);
+ 
    /* Enter the global namespace. */
    my_friendly_assert (global_namespace == NULL_TREE, 375);
    my_friendly_assert (current_lang_name == NULL_TREE, 375);
*************** revert_static_member_fn (decl, fn, argty
*** 14521,14561 ****
    if (argtypes)
      *argtypes = args;
  }
- 
- struct cp_function
- {
-   int returns_value;
-   int returns_null;
-   int assigns_this;
-   int just_assigned_this;
-   int parms_stored;
-   int temp_name_counter;
-   tree named_labels;
-   struct named_label_list *named_label_uses;
-   tree ctor_label;
-   tree dtor_label;
-   rtx last_dtor_insn;
-   rtx last_parm_cleanup_insn;
-   tree base_init_list;
-   tree member_init_list;
-   tree base_init_expr;
-   tree current_class_ptr;
-   tree current_class_ref;
-   rtx result_rtx;
-   struct cp_function *next;
-   struct binding_level *binding_level;
-   int static_labelno;
-   int in_function_try_handler;
-   int expanding_p;
-   int stmts_are_full_exprs_p; 
-   tree last_tree;
-   tree last_expr_type;
- };
  
! static struct cp_function *cp_function_chain;
  
- extern int temp_name_counter;
- 
  /* Save and reinitialize the variables
     used during compilation of a C++ function.  */
  
--- 14493,14501 ----
    if (argtypes)
      *argtypes = args;
  }
  
! struct cp_function *cp_function_chain;
  
  /* Save and reinitialize the variables
     used during compilation of a C++ function.  */
  
*************** void
*** 14563,14602 ****
  push_cp_function_context (context)
       tree context;
  {
!   struct cp_function *p
!     = (struct cp_function *) xmalloc (sizeof (struct cp_function));
  
    push_function_context_to (context);
  
    p->next = cp_function_chain;
    cp_function_chain = p;
  
-   p->named_labels = named_labels;
-   p->named_label_uses = named_label_uses;
-   p->returns_value = current_function_returns_value;
-   p->returns_null = current_function_returns_null;
-   p->binding_level = current_binding_level;
-   p->ctor_label = ctor_label;
-   p->dtor_label = dtor_label;
-   p->last_dtor_insn = last_dtor_insn;
-   p->last_parm_cleanup_insn = last_parm_cleanup_insn;
-   p->assigns_this = current_function_assigns_this;
-   p->just_assigned_this = current_function_just_assigned_this;
-   p->parms_stored = current_function_parms_stored;
-   p->result_rtx = original_result_rtx;
-   p->base_init_expr = base_init_expr;
-   p->temp_name_counter = temp_name_counter;
-   p->base_init_list = current_base_init_list;
-   p->member_init_list = current_member_init_list;
-   p->current_class_ptr = current_class_ptr;
-   p->current_class_ref = current_class_ref;
-   p->static_labelno = static_labelno;
-   p->in_function_try_handler = in_function_try_handler;
-   p->last_tree = last_tree;
-   p->last_expr_type = last_expr_type;
-   p->expanding_p = expanding_p;
-   p->stmts_are_full_exprs_p = stmts_are_full_exprs_p;
- 
    /* For now, we always assume we're expanding all the way to RTL
       unless we're explicitly doing otherwise.  */
    expanding_p = 1;
--- 14503,14522 ----
  push_cp_function_context (context)
       tree context;
  {
!   struct cp_function *p;
  
+   /* Push the language-independent context.  */
    push_function_context_to (context);
  
+   /* Push the C++-specific context.  */
+   p = (struct cp_function *) xmalloc (sizeof (struct cp_function));
+   if (cp_function_chain)
+     *p = *cp_function_chain;
+   else
+     bzero (p, sizeof (struct cp_function));
    p->next = cp_function_chain;
    cp_function_chain = p;
  
    /* For now, we always assume we're expanding all the way to RTL
       unless we're explicitly doing otherwise.  */
    expanding_p = 1;
*************** void
*** 14612,14649 ****
  pop_cp_function_context (context)
       tree context;
  {
!   struct cp_function *p = cp_function_chain;
  
    pop_function_context_from (context);
  
    cp_function_chain = p->next;
- 
-   named_labels = p->named_labels;
-   named_label_uses = p->named_label_uses;
-   current_function_returns_value = p->returns_value;
-   current_function_returns_null = p->returns_null;
-   current_binding_level = p->binding_level;
-   ctor_label = p->ctor_label;
-   dtor_label = p->dtor_label;
-   last_dtor_insn = p->last_dtor_insn;
-   last_parm_cleanup_insn = p->last_parm_cleanup_insn;
-   current_function_assigns_this = p->assigns_this;
-   current_function_just_assigned_this = p->just_assigned_this;
-   current_function_parms_stored = p->parms_stored;
-   original_result_rtx = p->result_rtx;
-   base_init_expr = p->base_init_expr;
-   temp_name_counter = p->temp_name_counter;
-   current_base_init_list = p->base_init_list;
-   current_member_init_list = p->member_init_list;
-   current_class_ptr = p->current_class_ptr;
-   current_class_ref = p->current_class_ref;
-   static_labelno = p->static_labelno;
-   in_function_try_handler = p->in_function_try_handler;
-   last_tree = p->last_tree;
-   last_expr_type = p->last_expr_type;
-   expanding_p = p->expanding_p;
-   stmts_are_full_exprs_p = p->stmts_are_full_exprs_p;
- 
    free (p);
  }
  
--- 14532,14545 ----
  pop_cp_function_context (context)
       tree context;
  {
!   struct cp_function *p;
  
+   /* Pop the language-independent context.  */
    pop_function_context_from (context);
  
+   /* Pop the C++-specific context.  */
+   p = cp_function_chain;
    cp_function_chain = p->next;
    free (p);
  }
  
Index: decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.246
diff -c -p -r1.246 decl2.c
*** decl2.c	1999/09/02 17:29:09	1.246
--- decl2.c	1999/09/02 19:00:17
*************** static size_t pending_statics_used;
*** 112,122 ****
  static varray_type saved_inlines;
  static size_t saved_inlines_used;
  
- /* Used to help generate temporary names which are unique within
-    a function.  Reset to 0 by start_function.  */
- 
- int temp_name_counter;
- 
  /* Same, but not reset.  Local temp variables and global temp variables
     can have the same name.  */
  static int global_temp_name_counter;
--- 112,117 ----
Index: init.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/init.c,v
retrieving revision 1.125
diff -c -p -r1.125 init.c
*** init.c	1999/09/02 03:13:16	1.125
--- init.c	1999/09/02 19:00:20
*************** Boston, MA 02111-1307, USA.  */
*** 33,49 ****
  #include "expr.h"
  #include "toplev.h"
  
- /* In C++, structures with well-defined constructors are initialized by
-    those constructors, unasked.  CURRENT_BASE_INIT_LIST
-    holds a list of stmts for a BASE_INIT term in the grammar.
-    This list has one element for each base class which must be
-    initialized.  The list elements are [basename, init], with
-    type basetype.  This allows the possibly anachronistic form
-    (assuming d : a, b, c) "d (int a) : c(a+5), b (a-4), a (a+3)"
-    where each successive term can be handed down the constructor
-    line.  Perhaps this was not intended.  */
- tree current_base_init_list, current_member_init_list;
- 
  static void expand_aggr_vbase_init_1 PROTO((tree, tree, tree, tree));
  static void construct_virtual_bases PROTO((tree, tree, tree, tree, tree));
  static void expand_aggr_init_1 PROTO((tree, tree, tree, tree, int));
--- 33,38 ----
*************** sort_base_init (t, rbase_ptr, vbase_ptr)
*** 501,508 ****
  
     Note that emit_base_init does *not* initialize virtual base
     classes.  That is done specially, elsewhere.  */
- 
- extern tree base_init_expr;
  
  void
  emit_base_init (t)
--- 490,495 ----
Index: method.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/method.c,v
retrieving revision 1.111
diff -c -p -r1.111 method.c
*** method.c	1999/08/26 04:19:52	1.111
--- method.c	1999/09/02 19:00:21
*************** Boston, MA 02111-1307, USA.  */
*** 47,54 ****
     processed.  */
  struct pending_inline *pending_inlines;
  
- int static_labelno;
- 
  #define obstack_chunk_alloc xmalloc
  #define obstack_chunk_free free
  
--- 47,52 ----
Index: pt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/pt.c,v
retrieving revision 1.346
diff -c -p -r1.346 pt.c
*** pt.c	1999/09/02 17:29:09	1.346
--- pt.c	1999/09/02 19:00:27
*************** tsubst_expr_values (t, argvec)
*** 9874,9881 ****
    return first;
  }
  
- tree last_tree;
- 
  void
  add_tree (t)
       tree t;
--- 9874,9879 ----
Index: semantics.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/semantics.c,v
retrieving revision 1.69
diff -c -p -r1.69 semantics.c
*** semantics.c	1999/08/30 15:50:40	1.69
--- semantics.c	1999/09/02 19:00:28
*************** static void expand_stmts PROTO((tree));
*** 45,73 ****
  static void do_pushlevel PROTO((void));
  static tree do_poplevel PROTO((void));
  
- /* Non-zero if we should generate RTL for functions that we process.
-    When this is zero, we just accumulate tree structure, without
-    interacting with the back end.  */
- int expanding_p = 1;
- 
- /* Non-zero if we should treat statements as full expressions.  In
-    particular, this variable is no-zero if at the end of a statement
-    we should destroy any temporaries created during that statement.
-    Similarly, if, at the end of a block, we should destroy any local
-    variables in this block.  Normally, this variable is non-zero,
-    since those are the normal semantics of C++.
- 
-    However, in order to represent aggregate initialization code as
-    tree structure, we use statement-expressions.  The statements
-    within the statement expression should not result in cleanups being
-    run until the entire enclosing statement is complete.  */
- int stmts_are_full_exprs_p = 1;
- 
- /* The type of the last expression-statement we have seen.  This is
-    required because the type of a statement-expression is the type of
-    the last expression statement.  */
- tree last_expr_type;
- 
  /* When parsing a template, LAST_TREE contains the last statement
     parsed.  These are chained together through the TREE_CHAIN field,
     but often need to be re-organized since the parse is performed
--- 45,50 ----
*************** finish_named_return_value (return_id, in
*** 1030,1037 ****
  void
  setup_vtbl_ptr ()
  {
-   extern tree base_init_expr;
- 
    if (base_init_expr == 0
        && DECL_CONSTRUCTOR_P (current_function_decl))
      {
--- 1007,1012 ----
Index: typeck.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/typeck.c,v
retrieving revision 1.199
diff -c -p -r1.199 typeck.c
*** typeck.c	1999/08/29 01:39:03	1.199
--- typeck.c	1999/09/02 19:00:31
*************** void
*** 6773,6779 ****
  c_expand_return (retval)
       tree retval;
  {
-   extern tree dtor_label, ctor_label;
    tree result = DECL_RESULT (current_function_decl);
    tree valtype = TREE_TYPE (result);
  
--- 6773,6778 ----


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