OSDN Git Service

* cp-tree.h (language_function): Add x_eh_spec_try_block. Add
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Sep 1999 23:45:52 +0000 (23:45 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 17 Sep 1999 23:45:52 +0000 (23:45 +0000)
x_scope_stmt_stack.  Add x_in_charge_parm.
(current_eh_spec_try_block): New macro.
(current_scope_stmt_stack): Likewise.
(current_in_charge_parm): Likewise.
* decl.c (start_function): Initialize current_in_charge_parm.
(finish_function): Use current_in_charge_parm rather than looking
up __in_chrg.
* search.c (expand_indirect_vtbls_init): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29489 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/search.c

index 65e1b82..3d21846 100644 (file)
@@ -1,5 +1,15 @@
 1999-09-17  Mark Mitchell  <mark@codesourcery.com>
 
+       * cp-tree.h (language_function): Add x_eh_spec_try_block.  Add
+       x_scope_stmt_stack.  Add x_in_charge_parm.
+       (current_eh_spec_try_block): New macro.
+       (current_scope_stmt_stack): Likewise.
+       (current_in_charge_parm): Likewise.
+       * decl.c (start_function): Initialize current_in_charge_parm.
+       (finish_function): Use current_in_charge_parm rather than looking
+       up __in_chrg.
+       * search.c (expand_indirect_vtbls_init): Likewise.
+
        * cp-tree.def (CLEANUP_STMT): Fix spelling in dumps.
        (TRY_BLOCK): Likewise.
        (HANDLER): Likewise.
index 57a7ad5..8ef874a 100644 (file)
@@ -623,6 +623,9 @@ struct language_function
   tree x_current_class_ref;
   tree x_last_tree;
   tree x_last_expr_type;
+  tree x_eh_spec_try_block;
+  tree x_scope_stmt_stack;
+  tree x_in_charge_parm;
 
   struct rtx_def *x_last_dtor_insn;
   struct rtx_def *x_last_parm_cleanup_insn;
@@ -695,6 +698,20 @@ struct language_function
 
 #define last_expr_type cp_function_chain->x_last_expr_type
 
+/* The TRY_BLOCK for the exception-specifiers for the current
+   function, if any.  */
+
+#define current_eh_spec_try_block cp_function_chain->x_eh_spec_try_block
+
+/* The stack of SCOPE_STMTs for the current function.  */
+
+#define current_scope_stmt_stack cp_function_chain->x_scope_stmt_stack
+
+/* The `__in_chrg' parameter for the current function.  Only used for
+   destructors.  */
+
+#define current_in_charge_parm cp_function_chain->x_in_charge_parm
+
 /* Set to 0 at beginning of a function definition, set to 1 if
    a return statement that specifies a return value is seen.  */
 
index b888eb0..c57aa0a 100644 (file)
@@ -13001,6 +13001,9 @@ start_function (declspecs, declarator, attrs, flags)
            = build_indirect_ref (t, NULL_PTR);
          cp_function_chain->x_current_class_ptr = t;
          
+         if (DECL_DESTRUCTOR_P (decl1))
+           current_in_charge_parm = TREE_CHAIN (t);
+
          resume_momentary (i);
          if (! hack_decl_function_context (decl1))
            end_temporary_allocation ();
@@ -13374,7 +13377,6 @@ finish_function (lineno, flags)
          tree binfo = TYPE_BINFO (current_class_type);
          tree cond = integer_one_node;
          tree exprstmt;
-         tree in_charge_node = lookup_name (in_charge_identifier, 0);
          tree virtual_size;
          int ok_to_optimize_dtor = 0;
          int empty_dtor = get_last_insn () == last_dtor_insn;
@@ -13424,7 +13426,9 @@ finish_function (lineno, flags)
            exprstmt = build_delete (current_class_type, current_class_ref, integer_zero_node,
                                     LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_NORMAL, 0);
          else
-           exprstmt = build_delete (current_class_type, current_class_ref, in_charge_node,
+           exprstmt = build_delete (current_class_type,
+                                    current_class_ref, 
+                                    current_in_charge_parm,
                                     LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR|LOOKUP_NORMAL, 0);
 
          /* If we did not assign to this, then `this' is non-zero at
@@ -13451,7 +13455,8 @@ finish_function (lineno, flags)
                {
                  tree vbases = nreverse (copy_list (CLASSTYPE_VBASECLASSES (current_class_type)));
                  expand_start_cond (build (BIT_AND_EXPR, integer_type_node,
-                                           in_charge_node, integer_two_node), 0);
+                                           current_in_charge_parm, 
+                                           integer_two_node), 0);
                  while (vbases)
                    {
                      if (TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (vbases)))
@@ -13499,7 +13504,7 @@ finish_function (lineno, flags)
          if (exprstmt)
            {
              cond = build (BIT_AND_EXPR, integer_type_node,
-                           in_charge_node, integer_one_node);
+                           current_in_charge_parm, integer_one_node);
              expand_start_cond (cond, 0);
              expand_expr_stmt (exprstmt);
              expand_end_cond ();
index 818ab14..6e81465 100644 (file)
@@ -2784,7 +2784,7 @@ expand_indirect_vtbls_init (binfo, true_exp, decl_ptr)
 
       if (fixup_insns)
        {
-         tree in_charge_node = lookup_name (in_charge_identifier, 0);
+         tree in_charge_node = current_in_charge_parm;
          if (! in_charge_node)
            {
              warning ("recoverable internal compiler error, nobody's in charge!");