aboutsummaryrefslogtreecommitdiff
path: root/gcc/except.c
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>2002-04-03 19:11:00 -0500
committerJason Merrill <jason@gcc.gnu.org>2002-04-03 19:11:00 -0500
commit659e5a7aa97fad95cccf792deb73810f906c1a80 (patch)
treee7c013fd4dcc1ce433e1cbcd41032def785b9193 /gcc/except.c
parent053d3344d411a28cb7d59ea924e7e81caa0255e8 (diff)
downloadgcc-659e5a7aa97fad95cccf792deb73810f906c1a80.zip
gcc-659e5a7aa97fad95cccf792deb73810f906c1a80.tar.gz
gcc-659e5a7aa97fad95cccf792deb73810f906c1a80.tar.bz2
re PR c++/5636 (gcc-3.0.3, memory leakage: function that take a string as parameter will not call local variable destructors if exception is thrown.)
PR c++/5636 * tree.h (CLEANUP_EH_ONLY): New macro. * stmt.c (expand_decl_cleanup_eh): New fn. (expand_cleanups): Check CLEANUP_EH_ONLY. * c-semantics.c (genrtl_decl_cleanup): Just take the CLEANUP_STMT. Use expand_decl_cleanup_eh. (expand_stmt): Adjust. * c-common.h: Adjust prototype. * cp/semantics.c (nullify_returns_r): Just set CLEANUP_EH_ONLY on cleanup for nrv. * except.c (struct eh_status): Remove protect_list. (begin_protect_partials, end_protect_partials): Remove. (add_partial_entry): Remove. * except.h: Remove prototypes. * expr.c (expand_expr) [WITH_CLEANUP_EXPR, TARGET_EXPR]: Use expand_decl_cleanup_eh. cp/: * semantics.c (finish_eh_cleanup): New fn. * cp-tree.h: Add prototype. * init.c (perform_member_init, expand_cleanup_for_base): Use finish_eh_cleanup. * cp-tree.def (SUBOBJECT, CTOR_STMT): Remove. * cp-tree.h: Remove references. * decl.c (begin_constructor_body, end_constructor_body): Likewise. * dump.c (cp_dump_tree): Likewise. * pt.c (tsubst_expr): Likewise. * semantics.c (genrtl_ctor_stmt, genrtl_subobject): Remove. (cp_expand_stmt): Remove handling of CTOR_STMT and SUBOBJECT. * tree.c (cp_statement_code_p): Likewise. * init.c (build_new_1): Set CLEANUP_EH_ONLY on deleting cleanup. From-SVN: r51827
Diffstat (limited to 'gcc/except.c')
-rw-r--r--gcc/except.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/gcc/except.c b/gcc/except.c
index 3eb31bd..e5079f9 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -214,12 +214,6 @@ struct eh_status
/* This is the region for which we are processing catch blocks. */
struct eh_region *try_region;
- /* A stack (TREE_LIST) of lists of handlers. The TREE_VALUE of each
- node is itself a TREE_CHAINed list of handlers for regions that
- are not yet closed. The TREE_VALUE of each entry contains the
- handler for the corresponding entry on the ehstack. */
- tree protect_list;
-
rtx filter;
rtx exc_ptr;
@@ -560,7 +554,6 @@ mark_eh_status (eh)
tree_done:;
}
- ggc_mark_tree (eh->protect_list);
ggc_mark_rtx (eh->filter);
ggc_mark_rtx (eh->exc_ptr);
ggc_mark_tree_varray (eh->ttype_data);
@@ -1012,55 +1005,6 @@ get_exception_filter (fun)
return filter;
}
-/* Begin a region that will contain entries created with
- add_partial_entry. */
-
-void
-begin_protect_partials ()
-{
- /* Push room for a new list. */
- cfun->eh->protect_list
- = tree_cons (NULL_TREE, NULL_TREE, cfun->eh->protect_list);
-}
-
-/* Start a new exception region for a region of code that has a
- cleanup action and push the HANDLER for the region onto
- protect_list. All of the regions created with add_partial_entry
- will be ended when end_protect_partials is invoked.
-
- ??? The only difference between this purpose and that of
- expand_decl_cleanup is that in this case, we only want the cleanup to
- run if an exception is thrown. This should also be handled using
- binding levels. */
-
-void
-add_partial_entry (handler)
- tree handler;
-{
- expand_eh_region_start ();
-
- /* Add this entry to the front of the list. */
- TREE_VALUE (cfun->eh->protect_list)
- = tree_cons (NULL_TREE, handler, TREE_VALUE (cfun->eh->protect_list));
-}
-
-/* End all the pending exception regions on protect_list. */
-
-void
-end_protect_partials ()
-{
- tree t;
-
- /* Pop the topmost entry. */
- t = TREE_VALUE (cfun->eh->protect_list);
- cfun->eh->protect_list = TREE_CHAIN (cfun->eh->protect_list);
-
- /* End all the exception regions. */
- for (; t; t = TREE_CHAIN (t))
- expand_eh_region_end_cleanup (TREE_VALUE (t));
-}
-
-
/* This section is for the exception handling specific optimization pass. */
/* Random access the exception region tree. It's just as simple to