except.c (expand_start_try_stmts): Move to except.c in the backend.
authorBob Manson <manson@charmed.cygnus.com>
Thu, 5 Sep 1996 00:43:02 +0000 (00:43 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Thu, 5 Sep 1996 00:43:02 +0000 (00:43 +0000)
* except.c (expand_start_try_stmts): Move to except.c in the backend.
(expand_end_try_stmts): Remove.

* init.c (perform_member_init): Use add_partial_entry () instead
of directly manipulating lists.
(emit_base_init): Ditto.

From-SVN: r12689

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/except.c
gcc/cp/init.c
gcc/cp/parse.y

index 8527738c94ffc10bd1b57ee7be847f9417486f32..7bae0fcbd9b0f0ed3069f5c3448b33f21c8da1c6 100644 (file)
@@ -1,3 +1,12 @@
+Wed Sep  4 17:16:09 1996  Bob Manson  <manson@charmed.cygnus.com>
+
+       * except.c (expand_start_try_stmts): Move to except.c in the backend.
+       (expand_end_try_stmts): Remove.
+
+       * init.c (perform_member_init): Use add_partial_entry () instead
+       of directly manipulating lists.
+       (emit_base_init): Ditto.
+
 Thu Aug 22 01:09:22 1996  Jason Merrill  <jason@yorick.cygnus.com>
 
        * decl.c (start_function): Only check interface_* for templates
index 441fe6931304f7d208e39fb32e4c95bca3ab42dc..d48257d6bd68d9c7e52dfb7b6e4381cfa1e45e47 100644 (file)
@@ -2132,15 +2132,7 @@ extern void check_default_args                   PROTO((tree));
 extern void mark_used                          PROTO((tree));
 
 /* in except.c */
-extern tree protect_list;
-extern void expand_eh_region_start             PROTO((void));
-extern void expand_eh_region_end               PROTO((tree));
-extern void end_protect_partials               PROTO((void));
 extern void expand_exception_blocks            PROTO((void));
-extern void expand_start_try_stmts             PROTO((void));
-extern void expand_end_try_stmts               PROTO((void));
-extern void expand_start_all_catch             PROTO((void));
-extern void expand_end_all_catch               PROTO((void));
 extern void start_catch_block                  PROTO((tree, tree));
 extern void end_catch_block                    PROTO((void));
 extern void expand_throw                       PROTO((tree));
index 16e5b20d12089beadccd4de2a6f48135b308783c..6086aa605ca70fd2396d743fbe04b44a300d0da2 100644 (file)
@@ -347,23 +347,6 @@ init_exception_processing ()
   saved_in_catch = lookup_name (get_identifier ("__eh_in_catch"), 0);
 }
 
-/* Call this on start of a try block.  */
-
-void
-expand_start_try_stmts ()
-{
-  if (! doing_eh (1))
-    return;
-
-  expand_eh_region_start ();
-}
-
-void
-expand_end_try_stmts ()
-{
-  expand_eh_region_end (integer_zero_node);
-}
-
 /* Build a type value for use at runtime for a type that is matched
    against by the exception handling system.  */
 
index 67df087bac12aa86e0ac0f1c612031a863b06c0a..8ac11e888d6e1bf35bfd7f470c6185468db8db19 100644 (file)
@@ -153,10 +153,9 @@ expand_direct_vtbls_init (real_binfo, binfo, init_self, can_elide, addr)
 /* Subroutine of emit_base_init.  */
 
 static void
-perform_member_init (member, name, init, explicit, protect_list)
+perform_member_init (member, name, init, explicit)
      tree member, name, init;
      int explicit;
-     tree *protect_list;
 {
   tree decl;
   tree type = TREE_TYPE (member);
@@ -244,10 +243,7 @@ perform_member_init (member, name, init, explicit, protect_list)
                           LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR, 0);
 
       if (expr != error_mark_node)
-       {
-         expand_eh_region_start ();
-         *protect_list = tree_cons (NULL_TREE, expr, *protect_list);
-       }
+       add_partial_entry (expr);
     }
 }
 
@@ -532,8 +528,6 @@ emit_base_init (t, immediately)
   int i, n_baseclasses = binfos ? TREE_VEC_LENGTH (binfos) : 0;
   tree expr = NULL_TREE;
 
-  my_friendly_assert (protect_list == NULL_TREE, 999);
-
   if (! immediately)
     {
       int momentary;
@@ -618,15 +612,14 @@ emit_base_init (t, immediately)
 
       if (TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (base_binfo)))
        {
-         expand_eh_region_start ();
+         tree expr;
 
          /* All cleanups must be on the function_obstack.  */
          push_obstacks_nochange ();
          resume_temporary_allocation ();
-         protect_list = tree_cons (NULL_TREE,
-                                   build_partial_cleanup_for (base_binfo),
-                                   protect_list);
+         expr = build_partial_cleanup_for (base_binfo);
          pop_obstacks ();
+         add_partial_entry (expr);
        }
 
       rbase_init_list = TREE_CHAIN (rbase_init_list);
@@ -677,7 +670,7 @@ emit_base_init (t, immediately)
          from_init_list = 0;
        }
 
-      perform_member_init (member, name, init, from_init_list, &protect_list);
+      perform_member_init (member, name, init, from_init_list);
       mem_init_list = TREE_CHAIN (mem_init_list);
     }
 
@@ -715,7 +708,7 @@ emit_base_init (t, immediately)
          my_friendly_assert (DECL_FIELD_CONTEXT (field) != t, 351);
 #endif
 
-         perform_member_init (field, name, init, 1, &protect_list);
+         perform_member_init (field, name, init, 1);
        }
       mem_init_list = TREE_CHAIN (mem_init_list);
     }
index 06c4d82a0ab0e41966237d0bfc22125b0211c73b..8e928f9f8c97ebf93e88c23a03b6668d385072c7 100644 (file)
@@ -3700,8 +3700,7 @@ function_try_block:
                  expand_start_early_try_stmts ();
                }
          ctor_initializer_opt compstmt_or_error
-               { expand_end_try_stmts ();
-                 expand_start_all_catch (); }
+               { expand_start_all_catch (); }
          handler_seq
                {
                  int nested = (hack_decl_function_context
@@ -3715,8 +3714,7 @@ try_block:
          TRY
                { expand_start_try_stmts (); }
          compstmt
-               { expand_end_try_stmts ();
-                 expand_start_all_catch (); }
+               { expand_start_all_catch (); }
          handler_seq
                { expand_end_all_catch (); }
        ;