diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-11-28 09:43:32 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-11-28 09:43:32 +0100 |
commit | 9e851845f6bcd7c13f3d42c13cd2f1c0e87f68cc (patch) | |
tree | 64d90923bdd9deb69efa042cc7ae54b08df598bf /gcc/jit | |
parent | 11c1e63c90eb3540da0b7524a2d7571916102dfe (diff) | |
download | gcc-9e851845f6bcd7c13f3d42c13cd2f1c0e87f68cc.tar.gz |
tree.def (SWITCH_EXPR): Change from 3 operand to 2 operand tree.
* tree.def (SWITCH_EXPR): Change from 3 operand to 2 operand tree.
Adjust comment.
* tree.h (SWITCH_LABELS): Remove.
* gimplify.c (gimplify_switch_expr): Don't test SWITCH_LABELS,
assert SWITCH_BODY is non-NULL.
* tree-pretty-print.c (dump_generic_node): Remove SWITCH_LABELS
handling.
* tree.c (block_may_fallthru): Always return true; for SWITCH_EXPR.
c/
* c-typeck.c (c_start_case): Build SWITCH_EXPR using build2 instead
of build3.
cp/
* cp-gimplify.c (genericize_switch_stmt): Build SWITCH_EXPR using
build2_loc instead of build3_loc.
ada/
* gcc-interface/trans.c (Case_Statement_to_gnu): Build SWITCH_EXPR
using build2 instead of build3.
jit/
* jit-playback.c (add_switch): Build SWITCH_EXPR using build2 instead
of build3. Formatting fixes. Adjust funciton comment.
fortran/
* trans-decl.c (gfc_trans_entry_master_switch): Build SWITCH_EXPR
using fold_build2_loc instead of fold_build3_loc.
* trans-io.c (io_result): Likewise.
* trans-stmt.c (gfc_trans_integer_select, gfc_trans_character_select):
Likewise.
go/
* go-gcc.cc (Gcc_backend::switch_statement): Build SWITCH_EXPR using
build2_loc instead of build3_loc.
brig/
* brigfrontend/brig-branch-inst-handler.cc
(brig_branch_inst_handler::operator): Build SWITCH_EXPR using build2
instead of build3.
From-SVN: r255192
Diffstat (limited to 'gcc/jit')
-rw-r--r-- | gcc/jit/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/jit/jit-playback.c | 19 |
2 files changed, 9 insertions, 15 deletions
diff --git a/gcc/jit/ChangeLog b/gcc/jit/ChangeLog index 35f21084116..afa53791d79 100644 --- a/gcc/jit/ChangeLog +++ b/gcc/jit/ChangeLog @@ -1,3 +1,8 @@ +2017-11-28 Jakub Jelinek <jakub@redhat.com> + + * jit-playback.c (add_switch): Build SWITCH_EXPR using build2 instead + of build3. Formatting fixes. Adjust funciton comment. + 2017-11-23 Tom de Vries <tom@codesourcery.com> * libgccjit.c (RETURN_NULL_IF_FAIL_NONNULL_NUMERIC_TYPE): Wrap in diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c index 95126c94393..fe9fb2d8bc2 100644 --- a/gcc/jit/jit-playback.c +++ b/gcc/jit/jit-playback.c @@ -1689,12 +1689,7 @@ add_case (tree *ptr_t_switch_body, /* Add a switch statement to the function's statement list. - My initial attempt at implementing this constructed a TREE_VEC - of the cases and set it as SWITCH_LABELS (switch_expr). However, - gimplify.c:gimplify_switch_expr is set up to deal with SWITCH_BODY, and - doesn't have any logic for gimplifying SWITCH_LABELS. - - Hence we create a switch body, and populate it with case labels, each + We create a switch body, and populate it with case labels, each followed by a goto to the desired block. */ void @@ -1722,18 +1717,12 @@ add_switch (location *loc, { tree t_low_value = c->m_min_value->as_tree (); tree t_high_value = c->m_max_value->as_tree (); - add_case (&t_switch_body, - t_low_value, - t_high_value, - c->m_dest_block); + add_case (&t_switch_body, t_low_value, t_high_value, c->m_dest_block); } /* Default label. */ - add_case (&t_switch_body, - NULL_TREE, NULL_TREE, - default_block); + add_case (&t_switch_body, NULL_TREE, NULL_TREE, default_block); - tree switch_stmt = build3 (SWITCH_EXPR, t_type, t_expr, - t_switch_body, NULL_TREE); + tree switch_stmt = build2 (SWITCH_EXPR, t_type, t_expr, t_switch_body); if (loc) set_tree_location (switch_stmt, loc); add_stmt (switch_stmt); |