diff options
author | Jason Merrill <jason@gcc.gnu.org> | 2002-04-03 19:11:00 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2002-04-03 19:11:00 -0500 |
commit | 659e5a7aa97fad95cccf792deb73810f906c1a80 (patch) | |
tree | e7c013fd4dcc1ce433e1cbcd41032def785b9193 /gcc/cp/cp-tree.h | |
parent | 053d3344d411a28cb7d59ea924e7e81caa0255e8 (diff) | |
download | gcc-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/cp/cp-tree.h')
-rw-r--r-- | gcc/cp/cp-tree.h | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index dbd9555..b65467b 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -47,7 +47,6 @@ struct diagnostic_context; ICS_USER_FLAG (in _CONV) CLEANUP_P (in TRY_BLOCK) AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR) - CTOR_BEGIN_P (in CTOR_STMT) BV_USE_VCALL_INDEX_P (in the BINFO_VIRTUALS TREE_LIST) PTRMEM_OK_P (in ADDR_EXPR, OFFSET_REF) PARMLIST_ELLIPSIS_P (in PARMLIST) @@ -2969,15 +2968,6 @@ enum ptrmemfunc_vbit_where_t #define HANDLER_PARMS(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 0) #define HANDLER_BODY(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 1) #define HANDLER_TYPE(NODE) TREE_TYPE (HANDLER_CHECK (NODE)) -#define SUBOBJECT_CLEANUP(NODE) TREE_OPERAND (SUBOBJECT_CHECK (NODE), 0) - -/* Nonzero if this CTOR_STMT is for the beginning of a constructor. */ -#define CTOR_BEGIN_P(NODE) \ - (TREE_LANG_FLAG_0 (CTOR_STMT_CHECK (NODE))) - -/* Nonzero if this CTOR_STMT is for the end of a constructor. */ -#define CTOR_END_P(NODE) \ - (!CTOR_BEGIN_P (NODE)) /* The parameters for a call-declarator. */ #define CALL_DECLARATOR_PARMS(NODE) \ @@ -4217,6 +4207,7 @@ extern tree finish_typeof PARAMS ((tree)); extern tree finish_sizeof PARAMS ((tree)); extern tree finish_alignof PARAMS ((tree)); extern void finish_decl_cleanup PARAMS ((tree, tree)); +extern void finish_eh_cleanup PARAMS ((tree)); extern void finish_named_return_value PARAMS ((tree, tree)); extern void expand_body PARAMS ((tree)); extern tree nullify_returns_r PARAMS ((tree *, int *, void *)); |