summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-15 20:08:39 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2002-03-15 20:08:39 +0000
commit7b6facbfebbdb440a4987249d026a84c73f6adeb (patch)
treedb4a627f532c42df854f6b4b67e6005e3d470c92 /gcc/tree-inline.c
parent87a9059882e0dd4fa7806a1100aa7b6bc55e38a9 (diff)
downloadgcc-7b6facbfebbdb440a4987249d026a84c73f6adeb.tar.gz
* c-common.c (statement_code_p): Handle CLEANUP_STMT.
* c-common.def (CLEANUP_STMT): New tree node. * c-common.h (CLEANUP_DECL): New macro. (CLEANUP_EXPR): Likewise. * c-semantics.c (expand_stmt): Handle CLEANUP_STMT. * tree-dump.c (dequeue_and_dump): Handle CLEANUP_STMT. * tree-inline.c (initialize_inlined_parameters): Clean up new local variables. * cp-tree.h (CLEANUP_DECL): Remove. (CLEANUP_EXPR): Likewise. * decl.c (destroy_local_var): Simplify. (maybe_build_cleanup): Tidy. * dump.c (cp_dump_tree): Remove handling of CLEANUP_STMT. * semantics.c (cp_expand_stmt): Likewise. * cp/tree.c (cp_statement_code_p): Likewise. * g++.dg/opt/dtor1.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@50830 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index f8ca55c780f..ce548849d2d 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -480,6 +480,7 @@ initialize_inlined_parameters (id, args, fn)
tree init_stmt;
tree var;
tree value;
+ tree cleanup;
/* Find the initializer. */
value = a ? TREE_VALUE (a) : NULL_TREE;
@@ -558,16 +559,26 @@ initialize_inlined_parameters (id, args, fn)
TREE_CHAIN (init_stmt) = init_stmts;
init_stmts = init_stmt;
}
+
+ /* See if we need to clean up the declaration. */
+ cleanup = maybe_build_cleanup (var);
+ if (cleanup)
+ {
+ tree cleanup_stmt;
+ /* Build the cleanup statement. */
+ cleanup_stmt = build_stmt (CLEANUP_STMT, var, cleanup);
+ /* Add it to the *front* of the list; the list will be
+ reversed below. */
+ TREE_CHAIN (cleanup_stmt) = init_stmts;
+ init_stmts = cleanup_stmt;
+ }
}
/* Evaluate trailing arguments. */
for (; a; a = TREE_CHAIN (a))
{
tree init_stmt;
- tree value;
-
- /* Find the initializer. */
- value = a ? TREE_VALUE (a) : NULL_TREE;
+ tree value = TREE_VALUE (a);
if (! value || ! TREE_SIDE_EFFECTS (value))
continue;