aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
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/tree.h
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/tree.h')
-rw-r--r--gcc/tree.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index ad24904..950463f 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -177,6 +177,9 @@ struct tree_common
INTEGER_CST, REAL_CST, COMPLEX_CST, VECTOR_CST
TREE_SYMBOL_REFERENCED in
IDENTIFIER_NODE
+ CLEANUP_EH_ONLY in
+ TARGET_EXPR, WITH_CLEANUP_EXPR, CLEANUP_STMT,
+ TREE_LIST elements of a block's cleanup list.
public_flag:
@@ -194,7 +197,7 @@ struct tree_common
TREE_VIA_PRIVATE in
TREE_LIST or TREE_VEC
TREE_PRIVATE in
- ??? unspecified nodes
+ ..._DECL
protected_flag:
@@ -203,7 +206,7 @@ struct tree_common
TREE_VEC
TREE_PROTECTED in
BLOCK
- ??? unspecified nodes
+ ..._DECL
side_effects_flag:
@@ -503,6 +506,11 @@ extern void tree_class_check_failed PARAMS ((const tree, int,
In a CONSTRUCTOR, nonzero means allocate static storage. */
#define TREE_STATIC(NODE) ((NODE)->common.static_flag)
+/* In a TARGET_EXPR, WITH_CLEANUP_EXPR, CLEANUP_STMT, or element of a
+ block's cleanup list, means that the pertinent cleanup should only be
+ executed if an exception is thrown, not on normal exit of its scope. */
+#define CLEANUP_EH_ONLY(NODE) ((NODE)->common.static_flag)
+
/* In a CONVERT_EXPR, NOP_EXPR or COMPOUND_EXPR, this means the node was
made implicitly and should not lead to an "unused value" warning. */
#define TREE_NO_UNUSED_WARNING(NODE) ((NODE)->common.static_flag)
@@ -2985,6 +2993,7 @@ extern void expand_elseif PARAMS ((tree));
extern void save_stack_pointer PARAMS ((void));
extern void expand_decl PARAMS ((tree));
extern int expand_decl_cleanup PARAMS ((tree, tree));
+extern int expand_decl_cleanup_eh PARAMS ((tree, tree, int));
extern void expand_anon_union_decl PARAMS ((tree, tree, tree));
extern void move_cleanups_up PARAMS ((void));
extern void expand_start_case_dummy PARAMS ((void));