aboutsummaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-04-17 01:47:36 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-04-17 01:47:36 +0000
commitb2123dc0d8b3c18313c9aae7bddf57af0b4a6bf7 (patch)
tree945ba924fcaf4c9312b124d4f9724e8c510bc166 /gcc/stmt.c
parentf0871dfe8ff3366c0404f151a722fc5de3f614c7 (diff)
downloadgcc-b2123dc0d8b3c18313c9aae7bddf57af0b4a6bf7.zip
gcc-b2123dc0d8b3c18313c9aae7bddf57af0b4a6bf7.tar.gz
gcc-b2123dc0d8b3c18313c9aae7bddf57af0b4a6bf7.tar.bz2
c-common.h (STMT_EXPR_NO_SCOPE): New macro.
* c-common.h (STMT_EXPR_NO_SCOPE): New macro. * c-common.c (c_expand_expr): Respect STMT_EXPR_NO_SCOPE. * tree.h (expand_start_stmt_expr): Update prototype. * stmt.c (expand_start_stmt_expr): Add has_scope parameter. * tree-inline.c (expand_call_inline): Set STMT_EXPR_NO_SCOPE on the STMT_EXPR created for the inline function. * trans.c (tree_transform): Add has_scope argument to expand_start_stmt_expr. * com.c (ffecom_expr_power_integer): Add has_scope argument to call to expand_start_stmt_expr. * init.c (begin_init_stmts): Remove commented out code. (finish_init_stmts): Set STMT_EXPR_NO_SCOPE. * semantics.c (begin_gobal_stmt_expr): Adjust call to expand_start_stmt_expr. From-SVN: r52395
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 32a1541..fe0e718 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -2405,12 +2405,16 @@ clear_last_expr ()
last_expr_type = 0;
}
-/* Begin a statement which will return a value.
- Return the RTL_EXPR for this statement expr.
- The caller must save that value and pass it to expand_end_stmt_expr. */
+/* Begin a statement-expression, i.e., a series of statements which
+ may return a value. Return the RTL_EXPR for this statement expr.
+ The caller must save that value and pass it to
+ expand_end_stmt_expr. If HAS_SCOPE is nonzero, temporaries created
+ in the statement-expression are deallocated at the end of the
+ expression. */
tree
-expand_start_stmt_expr ()
+expand_start_stmt_expr (has_scope)
+ int has_scope;
{
tree t;
@@ -2418,7 +2422,10 @@ expand_start_stmt_expr ()
so that rtl_expr_chain doesn't become garbage. */
t = make_node (RTL_EXPR);
do_pending_stack_adjust ();
- start_sequence_for_rtl_expr (t);
+ if (has_scope)
+ start_sequence_for_rtl_expr (t);
+ else
+ start_sequence ();
NO_DEFER_POP;
expr_stmts_for_value++;
last_expr_value = NULL_RTX;