summaryrefslogtreecommitdiff
path: root/gcc/c-gimplify.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-18 22:51:57 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-18 22:51:57 +0000
commit2b4cffe7faed0a23e9d0c4c0596dfe7155a85ab1 (patch)
tree2762b11388dd64d6b16fe86a4039c2bb93c95ba6 /gcc/c-gimplify.c
parent72c90b151433ec53bdeba9931e5e8c6f88369179 (diff)
downloadgcc-2b4cffe7faed0a23e9d0c4c0596dfe7155a85ab1.tar.gz
PR c++/16034
* c-gimplify.c (gimplify_condition): Remove. (gimplify_c_loop, gimplify_if_stmt, gimplify_switch_stmt): Don't call it. cp/ * semantics.c (begin_cond): New. (finish_cond): Rewrite to handle template DECL_STMTs specially. Assume that non-template decls go land before the conditional. (simplify_loop_decl_cond): Likewise. (begin_if_stmt, finish_if_stmt_cond, begin_while_stmt, finish_while_stmt_cond, finish_for_init_stmt, finish_for_cond, begin_switch_stmt, finish_switch_cond): Update to match. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83368 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-gimplify.c')
-rw-r--r--gcc/c-gimplify.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/gcc/c-gimplify.c b/gcc/c-gimplify.c
index 933b24faf31..7334621106a 100644
--- a/gcc/c-gimplify.c
+++ b/gcc/c-gimplify.c
@@ -86,7 +86,6 @@ static tree gimplify_c_loop (tree, tree, tree, bool);
static void push_context (void);
static void pop_context (void);
static void add_block_to_enclosing (tree);
-static void gimplify_condition (tree *);
enum bc_t { bc_break = 0, bc_continue = 1 };
static tree begin_bc_block (enum bc_t);
@@ -417,23 +416,6 @@ gimplify_expr_stmt (tree *stmt_p)
return GS_OK;
}
-/* If the condition for a loop (or the like) is a decl, it will be a
- TREE_LIST where the TREE_PURPOSE is a DECL_STMT and the TREE_VALUE is
- a use of the decl. Turn such a thing into a COMPOUND_EXPR. */
-
-static void
-gimplify_condition (tree *cond_p)
-{
- tree cond = *cond_p;
- if (cond && TREE_CODE (cond) == TREE_LIST)
- {
- tree decl = TREE_PURPOSE (cond);
- tree value = TREE_VALUE (cond);
- gimplify_stmt (&decl);
- *cond_p = build (COMPOUND_EXPR, TREE_TYPE (value), decl, value);
- }
-}
-
/* Begin a scope which can be exited by a break or continue statement. BC
indicates which.
@@ -548,7 +530,6 @@ gimplify_c_loop (tree cond, tree body, tree incr, bool cond_is_first)
exit = build_and_jump (&LABEL_EXPR_LABEL (top));
if (cond)
{
- gimplify_condition (&cond);
t = build_bc_goto (bc_break);
exit = build (COND_EXPR, void_type_node, cond, exit, t);
exit = fold (exit);
@@ -647,7 +628,6 @@ gimplify_if_stmt (tree *stmt_p)
else_ = build_empty_stmt ();
stmt = build (COND_EXPR, void_type_node, IF_COND (stmt), then_, else_);
- gimplify_condition (& TREE_OPERAND (stmt, 0));
*stmt_p = stmt;
return GS_OK;
@@ -664,8 +644,6 @@ gimplify_switch_stmt (tree *stmt_p)
break_block = begin_bc_block (bc_break);
- gimplify_condition (&SWITCH_COND (stmt));
-
body = SWITCH_BODY (stmt);
if (!body)
body = build_empty_stmt ();