summaryrefslogtreecommitdiff
path: root/gcc/c-gimplify.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-20 09:18:13 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-20 09:18:13 +0000
commitdddab69e1d0efc5578831788c1a9ba86fa66bfb1 (patch)
tree5f34633f30f7aaefd64e454886114b31df3b8155 /gcc/c-gimplify.c
parent9b38b3f6ca644320bd50f18435a04e9a35a59d6c (diff)
downloadgcc-dddab69e1d0efc5578831788c1a9ba86fa66bfb1.tar.gz
* c-common.def (IF_STMT, CLEANUP_STMT): Move to cp-tree.def.
* c-common.h (IF_COND, THEN_CLAUSE, ELSE_CLAUSE, CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move to cp-tree.h. (c_common_stmt_codes): Remove IF_STMT, CLEANUP_STMT. * c-dump.c (c_dump_tree): Move IF_STMT, CLEANUP_STMT to cp_dump_tree. * c-pretty-print.c (pp_c_statement): Similarly. * c-gimplify.c (gimplify_cleanup_stmt, gimplify_cleanup_stmts, gimplify_if_stmt): Move to cp-gimplify.c. (c_genericize, c_gimplify_expr): Don't call them. * c-semantics.c (push_cleanup): Move to cp/semantics.c. * c-typeck.c (push_cleanup): New. (c_begin_if_stmt, c_finish_if_cond, c_finish_then, c_finish_else, c_finish_if_stmt): Use COND_EXPR. * tree.h (CLEANUP_EH_ONLY): Update documentation. cp/ * cp-tree.def (CLEANUP_STMT, IF_STMT): Move from c-common.def. * cp-gimplify.c (gimplify_if_stmt): Move from c-gimplify.c. (cp_gimplify_expr): Call it. (gimplify_cleanup_stmt): Move from c-gimplify.c. (cp_genericize): New. * decl.c (finish_function): Call it. * cp-tree.h (cp_stmt_codes): Add CLEANUP_STMT, IF_STMT. (CLEANUP_BODY, CLEANUP_EXPR, CLEANUP_DECL): Move from c-common.h. (IF_COND, THEN_CLAUSE, ELSE_CLAUSE): Likewise. (cp_genericize): Declare. * cxx-pretty-print.c (pp_cxx_statement): Add CLEANUP_STMT, IF_STMT. * dump.c (cp_dump_tree): Likewise. * semantics.c (push_cleanup): Move from c-semantics.c. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83407 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-gimplify.c')
-rw-r--r--gcc/c-gimplify.c52
1 files changed, 0 insertions, 52 deletions
diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c
index 1f8ce647b9d..fa3ea299cc4 100644
--- a/gcc/c-gimplify.c
+++ b/gcc/c-gimplify.c
@@ -72,8 +72,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Local declarations. */
-static void gimplify_cleanup_stmts (tree);
-
enum bc_t { bc_break = 0, bc_continue = 1 };
static struct c_gimplify_ctx
@@ -137,7 +135,6 @@ c_genericize (tree fndecl)
/* Go ahead and gimplify for now. */
push_context ();
- gimplify_cleanup_stmts (fndecl);
gimplify_function_tree (fndecl);
pop_context ();
@@ -152,30 +149,6 @@ c_genericize (tree fndecl)
c_genericize (cgn->decl);
}
-/* Genericize a CLEANUP_STMT. This just turns into a TRY_FINALLY or
- TRY_CATCH depending on whether it's EH-only. */
-
-static tree
-gimplify_cleanup_stmt (tree *stmt_p, int *walk_subtrees,
- void *data ATTRIBUTE_UNUSED)
-{
- tree stmt = *stmt_p;
-
- if (DECL_P (stmt) || TYPE_P (stmt))
- *walk_subtrees = 0;
- else if (TREE_CODE (stmt) == CLEANUP_STMT)
- *stmt_p = build (CLEANUP_EH_ONLY (stmt) ? TRY_CATCH_EXPR : TRY_FINALLY_EXPR,
- void_type_node, CLEANUP_BODY (stmt), CLEANUP_EXPR (stmt));
-
- return NULL;
-}
-
-static void
-gimplify_cleanup_stmts (tree fndecl)
-{
- walk_tree (&DECL_SAVED_TREE (fndecl), gimplify_cleanup_stmt, NULL, NULL);
-}
-
static void
add_block_to_enclosing (tree block)
{
@@ -479,28 +452,6 @@ gimplify_do_stmt (tree *stmt_p)
return GS_ALL_DONE;
}
-/* Genericize an IF_STMT by turning it into a COND_EXPR. */
-
-static enum gimplify_status
-gimplify_if_stmt (tree *stmt_p)
-{
- tree stmt, then_, else_;
-
- stmt = *stmt_p;
- then_ = THEN_CLAUSE (stmt);
- else_ = ELSE_CLAUSE (stmt);
-
- if (!then_)
- then_ = build_empty_stmt ();
- if (!else_)
- else_ = build_empty_stmt ();
-
- stmt = build (COND_EXPR, void_type_node, IF_COND (stmt), then_, else_);
- *stmt_p = stmt;
-
- return GS_OK;
-}
-
/* Genericize a SWITCH_STMT by turning it into a SWITCH_EXPR. */
static enum gimplify_status
@@ -670,9 +621,6 @@ c_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED)
case DO_STMT:
return gimplify_do_stmt (expr_p);
- case IF_STMT:
- return gimplify_if_stmt (expr_p);
-
case SWITCH_STMT:
return gimplify_switch_stmt (expr_p);