aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2000-06-26 02:18:14 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2000-06-26 02:18:14 +0000
commit596fd31c72350cdd6b4e283c6e8f2757220a7322 (patch)
tree52f7fe189833adff3c33803e82193be734e83e19 /gcc/cp/semantics.c
parentb42115f711f164a05b1e9f3ca5565eb74ab3964b (diff)
downloadgcc-596fd31c72350cdd6b4e283c6e8f2757220a7322.zip
gcc-596fd31c72350cdd6b4e283c6e8f2757220a7322.tar.gz
gcc-596fd31c72350cdd6b4e283c6e8f2757220a7322.tar.bz2
cp-tree.h (genrtl_begin_stmt_expr): Rename to ...
* cp-tree.h (genrtl_begin_stmt_expr): Rename to ... (begin_global_stmt_expr): ... this. (genrtl_finish_stmt_expr): Rename to ... (finish_global_stmt_expr): ... this. * init.c (begin_init_stmts): Adjust calls. (finish_init_stmts): Likewise. * semantics.c (genrtl_begin_stmt_expr): Rename to ... (begin_global_stmt_expr): ... this. (genrtl_finish_stmt_expr): Rename to ... (finish_global_stmt_expr): ... this. From-SVN: r34702
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c43
1 files changed, 20 insertions, 23 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 68dac42..aa95da8 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -1776,21 +1776,6 @@ finish_parenthesized_expr (expr)
return expr;
}
-/* The last_tree will be NULL_TREE when entering this function. Unlike
- the other genrtl functions, in this function, that state can change
- hence the check at the end as in the original version of
- begin_stmt_expr. Generate the RTL for the start of a STMT_EXPR. */
-tree
-genrtl_begin_stmt_expr ()
-{
- if (! cfun && !last_tree)
- begin_stmt_tree (&scope_chain->x_saved_tree);
-
- keep_next_level (1);
-
- return (last_tree != NULL_TREE) ? last_tree : expand_start_stmt_expr();
-}
-
/* Begin a statement-expression. The value returned must be passed to
finish_stmt_expr. */
@@ -1811,22 +1796,34 @@ begin_stmt_expr ()
return last_tree;
}
-/* Generate the RTL for the end of the STMT_EXPR. */
+/* Used when beginning a statement-expression outside function scope.
+ For example, when handling a file-scope initializer, we use this
+ function. */
-tree
-genrtl_finish_stmt_expr (rtl_expr)
- tree rtl_expr;
+tree
+begin_global_stmt_expr ()
{
- tree result;
+ if (! cfun && !last_tree)
+ begin_stmt_tree (&scope_chain->x_saved_tree);
+
+ keep_next_level (1);
+
+ return (last_tree != NULL_TREE) ? last_tree : expand_start_stmt_expr();
+}
+
+/* Finish the STMT_EXPR last begun with begin_global_stmt_expr. */
- rtl_expr = expand_end_stmt_expr (rtl_expr);
- result = rtl_expr;
+tree
+finish_global_stmt_expr (stmt_expr)
+ tree stmt_expr;
+{
+ stmt_expr = expand_end_stmt_expr (stmt_expr);
if (! cfun
&& TREE_CHAIN (scope_chain->x_saved_tree) == NULL_TREE)
finish_stmt_tree (&scope_chain->x_saved_tree);
- return result;
+ return stmt_expr;
}
/* Finish a statement-expression. RTL_EXPR should be the value