generalize build_case_label to the rest of the compiler
generalize build_case_label to the rest of the compiler gcc/ada/ * gcc-interface/trans.c (Case_Statement_to_gnu): Call build_case_label. gcc/ * except.c (sjlj_emit_dispatch_table): Call build_case_label. * gimplify.c (gimplify_switch_expr): Likewise. * omp-low.c (expand_omp_sections): Likewise. * tree-eh.c (lower_try_finally_switch): Likewise. (lower_eh_dispatch): Likewise. * tree.h (build_case_label): Declare. * tree.c (build_case_label): Define. gcc/c-family/ * c-common.c (c_add_case_label): Omit the loc argument to build_case_label. * c-common.h (build_case_label): Remove. * c-semantics.c (build_case_label): Remove. gcc/cp/ * decl.c (finish_case_label): Omit the loc argument to build_case_label. gcc/fortran/ * trans-decl.c (gfc_trans_entry_master_switch): Call build_case_label. * trans-io.c (add_case): Likewise. * trans-stmt.c (gfc_trans_integer_select): Likewise. (gfc_trans_character_select): Likewise. gcc/go/ * go-gcc.cc (Gcc_backend::switch_statement): Call build_case_label. gcc/java/ * expr.c (expand_java_switch): Call build_case_label. (expand_java_add_case): Likewise. From-SVN: r173467
This commit is contained in:
parent
d7d058c58a
commit
3d528853ba
|
@ -1,3 +1,13 @@
|
||||||
|
2011-05-05 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
|
* except.c (sjlj_emit_dispatch_table): Call build_case_label.
|
||||||
|
* gimplify.c (gimplify_switch_expr): Likewise.
|
||||||
|
* omp-low.c (expand_omp_sections): Likewise.
|
||||||
|
* tree-eh.c (lower_try_finally_switch): Likewise.
|
||||||
|
(lower_eh_dispatch): Likewise.
|
||||||
|
* tree.h (build_case_label): Declare.
|
||||||
|
* tree.c (build_case_label): Define.
|
||||||
|
|
||||||
2011-05-05 Jason Merrill <jason@redhat.com>
|
2011-05-05 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
PR c++/40975
|
PR c++/40975
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2011-05-05 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
|
* gcc-interface/trans.c (Case_Statement_to_gnu): Call
|
||||||
|
build_case_label.
|
||||||
|
|
||||||
2011-05-05 Nathan Froyd <froydnj@codesourcery.com>
|
2011-05-05 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
* gcc-interface/decl.c (intrin_arglists_compatible_p): Use iterators
|
* gcc-interface/decl.c (intrin_arglists_compatible_p): Use iterators
|
||||||
|
|
|
@ -2028,9 +2028,8 @@ Case_Statement_to_gnu (Node_Id gnat_node)
|
||||||
if ((!gnu_low || TREE_CODE (gnu_low) == INTEGER_CST)
|
if ((!gnu_low || TREE_CODE (gnu_low) == INTEGER_CST)
|
||||||
&& (!gnu_high || TREE_CODE (gnu_high) == INTEGER_CST))
|
&& (!gnu_high || TREE_CODE (gnu_high) == INTEGER_CST))
|
||||||
{
|
{
|
||||||
add_stmt_with_node (build3
|
add_stmt_with_node (build_case_label
|
||||||
(CASE_LABEL_EXPR, void_type_node,
|
(gnu_low, gnu_high,
|
||||||
gnu_low, gnu_high,
|
|
||||||
create_artificial_label (input_location)),
|
create_artificial_label (input_location)),
|
||||||
gnat_choice);
|
gnat_choice);
|
||||||
choices_added_p = true;
|
choices_added_p = true;
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
2011-05-05 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
|
* c-common.c (c_add_case_label): Omit the loc argument to
|
||||||
|
build_case_label.
|
||||||
|
* c-common.h (build_case_label): Remove.
|
||||||
|
* c-semantics.c (build_case_label): Remove.
|
||||||
|
|
||||||
2011-05-05 Joseph Myers <joseph@codesourcery.com>
|
2011-05-05 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
* c-objc.h (objc_start_method_definition): Update prototype.
|
* c-objc.h (objc_start_method_definition): Update prototype.
|
||||||
|
|
|
@ -5327,7 +5327,7 @@ c_add_case_label (location_t loc, splay_tree cases, tree cond, tree orig_type,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add a CASE_LABEL to the statement-tree. */
|
/* Add a CASE_LABEL to the statement-tree. */
|
||||||
case_label = add_stmt (build_case_label (loc, low_value, high_value, label));
|
case_label = add_stmt (build_case_label (low_value, high_value, label));
|
||||||
/* Register this case label in the splay tree. */
|
/* Register this case label in the splay tree. */
|
||||||
splay_tree_insert (cases,
|
splay_tree_insert (cases,
|
||||||
(splay_tree_key) low_value,
|
(splay_tree_key) low_value,
|
||||||
|
|
|
@ -831,7 +831,6 @@ extern void warn_for_omitted_condop (location_t, tree);
|
||||||
|
|
||||||
extern tree do_case (location_t, tree, tree);
|
extern tree do_case (location_t, tree, tree);
|
||||||
extern tree build_stmt (location_t, enum tree_code, ...);
|
extern tree build_stmt (location_t, enum tree_code, ...);
|
||||||
extern tree build_case_label (location_t, tree, tree, tree);
|
|
||||||
extern tree build_real_imag_expr (location_t, enum tree_code, tree);
|
extern tree build_real_imag_expr (location_t, enum tree_code, tree);
|
||||||
|
|
||||||
/* These functions must be defined by each front-end which implements
|
/* These functions must be defined by each front-end which implements
|
||||||
|
|
|
@ -131,15 +131,6 @@ build_stmt (location_t loc, enum tree_code code, ...)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a CASE_LABEL_EXPR tree node and return it. */
|
|
||||||
|
|
||||||
tree
|
|
||||||
build_case_label (location_t loc,
|
|
||||||
tree low_value, tree high_value, tree label_decl)
|
|
||||||
{
|
|
||||||
return build_stmt (loc, CASE_LABEL_EXPR, low_value, high_value, label_decl);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Build a REALPART_EXPR or IMAGPART_EXPR, according to CODE, from ARG. */
|
/* Build a REALPART_EXPR or IMAGPART_EXPR, according to CODE, from ARG. */
|
||||||
|
|
||||||
tree
|
tree
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2011-05-05 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
|
* decl.c (finish_case_label): Omit the loc argument to
|
||||||
|
build_case_label.
|
||||||
|
|
||||||
2011-05-05 Jason Merrill <jason@redhat.com>
|
2011-05-05 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
* cp-tree.h (REFERENCE_REF_P): Just check the type.
|
* cp-tree.h (REFERENCE_REF_P): Just check the type.
|
||||||
|
|
|
@ -2970,7 +2970,7 @@ finish_case_label (location_t loc, tree low_value, tree high_value)
|
||||||
/* For templates, just add the case label; we'll do semantic
|
/* For templates, just add the case label; we'll do semantic
|
||||||
analysis at instantiation-time. */
|
analysis at instantiation-time. */
|
||||||
label = build_decl (loc, LABEL_DECL, NULL_TREE, NULL_TREE);
|
label = build_decl (loc, LABEL_DECL, NULL_TREE, NULL_TREE);
|
||||||
return add_stmt (build_case_label (loc, low_value, high_value, label));
|
return add_stmt (build_case_label (low_value, high_value, label));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the condition on which this switch statement depends. */
|
/* Find the condition on which this switch statement depends. */
|
||||||
|
|
|
@ -1285,12 +1285,11 @@ sjlj_emit_dispatch_table (rtx dispatch_label, int num_dispatch)
|
||||||
|
|
||||||
if (num_dispatch > 1)
|
if (num_dispatch > 1)
|
||||||
{
|
{
|
||||||
tree t_label, case_elt;
|
tree t_label, case_elt, t;
|
||||||
|
|
||||||
t_label = create_artificial_label (UNKNOWN_LOCATION);
|
t_label = create_artificial_label (UNKNOWN_LOCATION);
|
||||||
case_elt = build3 (CASE_LABEL_EXPR, void_type_node,
|
t = build_int_cst (integer_type_node, disp_index);
|
||||||
build_int_cst (integer_type_node, disp_index),
|
case_elt = build_case_label (t, NULL, t_label);
|
||||||
NULL, t_label);
|
|
||||||
gimple_switch_set_label (switch_stmt, disp_index, case_elt);
|
gimple_switch_set_label (switch_stmt, disp_index, case_elt);
|
||||||
|
|
||||||
label = label_rtx (t_label);
|
label = label_rtx (t_label);
|
||||||
|
|
|
@ -1,3 +1,10 @@
|
||||||
|
2011-05-05 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
|
* trans-decl.c (gfc_trans_entry_master_switch): Call build_case_label.
|
||||||
|
* trans-io.c (add_case): Likewise.
|
||||||
|
* trans-stmt.c (gfc_trans_integer_select): Likewise.
|
||||||
|
(gfc_trans_character_select): Likewise.
|
||||||
|
|
||||||
2011-05-05 Eric Botcazou <ebotcazou@adacore.com>
|
2011-05-05 Eric Botcazou <ebotcazou@adacore.com>
|
||||||
|
|
||||||
* trans-decl.c (trans_function_start): Do not set
|
* trans-decl.c (trans_function_start): Do not set
|
||||||
|
|
|
@ -4347,7 +4347,7 @@ gfc_trans_entry_master_switch (gfc_entry_list * el)
|
||||||
/* Add the case label. */
|
/* Add the case label. */
|
||||||
label = gfc_build_label_decl (NULL_TREE);
|
label = gfc_build_label_decl (NULL_TREE);
|
||||||
val = build_int_cst (gfc_array_index_type, el->id);
|
val = build_int_cst (gfc_array_index_type, el->id);
|
||||||
tmp = build3_v (CASE_LABEL_EXPR, val, NULL_TREE, label);
|
tmp = build_case_label (val, NULL_TREE, label);
|
||||||
gfc_add_expr_to_block (&block, tmp);
|
gfc_add_expr_to_block (&block, tmp);
|
||||||
|
|
||||||
/* And jump to the actual entry point. */
|
/* And jump to the actual entry point. */
|
||||||
|
|
|
@ -832,7 +832,7 @@ add_case (int label_value, gfc_st_label * label, stmtblock_t * body)
|
||||||
tmp = gfc_build_label_decl (NULL_TREE);
|
tmp = gfc_build_label_decl (NULL_TREE);
|
||||||
|
|
||||||
/* And the case itself. */
|
/* And the case itself. */
|
||||||
tmp = build3_v (CASE_LABEL_EXPR, value, NULL_TREE, tmp);
|
tmp = build_case_label (value, NULL_TREE, tmp);
|
||||||
gfc_add_expr_to_block (body, tmp);
|
gfc_add_expr_to_block (body, tmp);
|
||||||
|
|
||||||
/* Jump to the label. */
|
/* Jump to the label. */
|
||||||
|
|
|
@ -1770,8 +1770,7 @@ gfc_trans_integer_select (gfc_code * code)
|
||||||
|
|
||||||
/* Add this case label.
|
/* Add this case label.
|
||||||
Add parameter 'label', make it match GCC backend. */
|
Add parameter 'label', make it match GCC backend. */
|
||||||
tmp = fold_build3_loc (input_location, CASE_LABEL_EXPR,
|
tmp = build_case_label (low, high, label);
|
||||||
void_type_node, low, high, label);
|
|
||||||
gfc_add_expr_to_block (&body, tmp);
|
gfc_add_expr_to_block (&body, tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2048,8 +2047,7 @@ gfc_trans_character_select (gfc_code *code)
|
||||||
|
|
||||||
/* Add this case label.
|
/* Add this case label.
|
||||||
Add parameter 'label', make it match GCC backend. */
|
Add parameter 'label', make it match GCC backend. */
|
||||||
tmp = fold_build3_loc (input_location, CASE_LABEL_EXPR,
|
tmp = build_case_label (low, high, label);
|
||||||
void_type_node, low, high, label);
|
|
||||||
gfc_add_expr_to_block (&body, tmp);
|
gfc_add_expr_to_block (&body, tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2128,11 +2126,9 @@ gfc_trans_character_select (gfc_code *code)
|
||||||
for (d = c->ext.block.case_list; d; d = d->next)
|
for (d = c->ext.block.case_list; d; d = d->next)
|
||||||
{
|
{
|
||||||
label = gfc_build_label_decl (NULL_TREE);
|
label = gfc_build_label_decl (NULL_TREE);
|
||||||
tmp = fold_build3_loc (input_location, CASE_LABEL_EXPR,
|
tmp = build_case_label ((d->low == NULL && d->high == NULL)
|
||||||
void_type_node,
|
? NULL
|
||||||
(d->low == NULL && d->high == NULL)
|
: build_int_cst (integer_type_node, d->n),
|
||||||
? NULL : build_int_cst (integer_type_node,
|
|
||||||
d->n),
|
|
||||||
NULL, label);
|
NULL, label);
|
||||||
gfc_add_expr_to_block (&body, tmp);
|
gfc_add_expr_to_block (&body, tmp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1584,10 +1584,11 @@ gimplify_switch_expr (tree *expr_p, gimple_seq *pre_p)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == len)
|
if (i == len)
|
||||||
default_case = build3 (CASE_LABEL_EXPR, void_type_node,
|
{
|
||||||
NULL_TREE, NULL_TREE,
|
tree label = CASE_LABEL (VEC_index (tree, labels, 0));
|
||||||
CASE_LABEL (VEC_index (tree,
|
default_case = build_case_label (NULL_TREE, NULL_TREE,
|
||||||
labels, 0)));
|
label);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1596,8 +1597,7 @@ gimplify_switch_expr (tree *expr_p, gimple_seq *pre_p)
|
||||||
gimple new_default;
|
gimple new_default;
|
||||||
|
|
||||||
default_case
|
default_case
|
||||||
= build3 (CASE_LABEL_EXPR, void_type_node,
|
= build_case_label (NULL_TREE, NULL_TREE,
|
||||||
NULL_TREE, NULL_TREE,
|
|
||||||
create_artificial_label (UNKNOWN_LOCATION));
|
create_artificial_label (UNKNOWN_LOCATION));
|
||||||
new_default = gimple_build_label (CASE_LABEL (default_case));
|
new_default = gimple_build_label (CASE_LABEL (default_case));
|
||||||
gimplify_seq_add_stmt (&switch_body_seq, new_default);
|
gimplify_seq_add_stmt (&switch_body_seq, new_default);
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2011-05-05 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
|
* go-gcc.cc (Gcc_backend::switch_statement): Call build_case_label.
|
||||||
|
|
||||||
2011-05-04 Ian Lance Taylor <iant@google.com>
|
2011-05-04 Ian Lance Taylor <iant@google.com>
|
||||||
|
|
||||||
* go-gcc.cc (Gcc_backend::struct_type): Call fill_in_struct.
|
* go-gcc.cc (Gcc_backend::struct_type): Call fill_in_struct.
|
||||||
|
|
|
@ -835,8 +835,7 @@ Gcc_backend::switch_statement(
|
||||||
? EXPR_LOCATION((*ps)->get_tree())
|
? EXPR_LOCATION((*ps)->get_tree())
|
||||||
: UNKNOWN_LOCATION);
|
: UNKNOWN_LOCATION);
|
||||||
tree label = create_artificial_label(loc);
|
tree label = create_artificial_label(loc);
|
||||||
tree c = build3_loc(loc, CASE_LABEL_EXPR, void_type_node, NULL_TREE,
|
tree c = build_case_label(NULL_TREE, NULL_TREE, label);
|
||||||
NULL_TREE, label);
|
|
||||||
append_to_statement_list(c, &stmt_list);
|
append_to_statement_list(c, &stmt_list);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -850,8 +849,7 @@ Gcc_backend::switch_statement(
|
||||||
return this->error_statement();
|
return this->error_statement();
|
||||||
source_location loc = EXPR_LOCATION(t);
|
source_location loc = EXPR_LOCATION(t);
|
||||||
tree label = create_artificial_label(loc);
|
tree label = create_artificial_label(loc);
|
||||||
tree c = build3_loc(loc, CASE_LABEL_EXPR, void_type_node,
|
tree c = build_case_label((*pcv)->get_tree(), NULL_TREE, label);
|
||||||
(*pcv)->get_tree(), NULL_TREE, label);
|
|
||||||
append_to_statement_list(c, &stmt_list);
|
append_to_statement_list(c, &stmt_list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2011-05-05 Nathan Froyd <froydnj@codesourcery.com>
|
||||||
|
|
||||||
|
* expr.c (expand_java_switch): Call build_case_label.
|
||||||
|
(expand_java_add_case): Likewise.
|
||||||
|
|
||||||
2011-04-29 Richard Guenther <rguenther@suse.de>
|
2011-04-29 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
PR middle-end/48819
|
PR middle-end/48819
|
||||||
|
|
|
@ -1874,7 +1874,7 @@ expand_java_switch (tree selector, int default_pc)
|
||||||
NULL_TREE, NULL_TREE);
|
NULL_TREE, NULL_TREE);
|
||||||
java_add_stmt (switch_expr);
|
java_add_stmt (switch_expr);
|
||||||
|
|
||||||
x = build3 (CASE_LABEL_EXPR, void_type_node, NULL_TREE, NULL_TREE,
|
x = build_case_label (NULL_TREE, NULL_TREE,
|
||||||
create_artificial_label (input_location));
|
create_artificial_label (input_location));
|
||||||
append_to_statement_list (x, &SWITCH_BODY (switch_expr));
|
append_to_statement_list (x, &SWITCH_BODY (switch_expr));
|
||||||
|
|
||||||
|
@ -1891,7 +1891,7 @@ expand_java_add_case (tree switch_expr, int match, int target_pc)
|
||||||
|
|
||||||
value = build_int_cst (TREE_TYPE (switch_expr), match);
|
value = build_int_cst (TREE_TYPE (switch_expr), match);
|
||||||
|
|
||||||
x = build3 (CASE_LABEL_EXPR, void_type_node, value, NULL_TREE,
|
x = build_case_label (value, NULL_TREE,
|
||||||
create_artificial_label (input_location));
|
create_artificial_label (input_location));
|
||||||
append_to_statement_list (x, &SWITCH_BODY (switch_expr));
|
append_to_statement_list (x, &SWITCH_BODY (switch_expr));
|
||||||
|
|
||||||
|
|
|
@ -4774,8 +4774,7 @@ expand_omp_sections (struct omp_region *region)
|
||||||
i = 0;
|
i = 0;
|
||||||
if (exit_reachable)
|
if (exit_reachable)
|
||||||
{
|
{
|
||||||
t = build3 (CASE_LABEL_EXPR, void_type_node,
|
t = build_case_label (build_int_cst (unsigned_type_node, 0), NULL, l2);
|
||||||
build_int_cst (unsigned_type_node, 0), NULL, l2);
|
|
||||||
VEC_quick_push (tree, label_vec, t);
|
VEC_quick_push (tree, label_vec, t);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -4800,7 +4799,7 @@ expand_omp_sections (struct omp_region *region)
|
||||||
|
|
||||||
t = gimple_block_label (s_entry_bb);
|
t = gimple_block_label (s_entry_bb);
|
||||||
u = build_int_cst (unsigned_type_node, casei);
|
u = build_int_cst (unsigned_type_node, casei);
|
||||||
u = build3 (CASE_LABEL_EXPR, void_type_node, u, NULL, t);
|
u = build_case_label (u, NULL, t);
|
||||||
VEC_quick_push (tree, label_vec, u);
|
VEC_quick_push (tree, label_vec, u);
|
||||||
|
|
||||||
si = gsi_last_bb (s_entry_bb);
|
si = gsi_last_bb (s_entry_bb);
|
||||||
|
@ -4821,7 +4820,7 @@ expand_omp_sections (struct omp_region *region)
|
||||||
|
|
||||||
/* Error handling code goes in DEFAULT_BB. */
|
/* Error handling code goes in DEFAULT_BB. */
|
||||||
t = gimple_block_label (default_bb);
|
t = gimple_block_label (default_bb);
|
||||||
u = build3 (CASE_LABEL_EXPR, void_type_node, NULL, NULL, t);
|
u = build_case_label (NULL, NULL, t);
|
||||||
make_edge (l0_bb, default_bb, 0);
|
make_edge (l0_bb, default_bb, 0);
|
||||||
|
|
||||||
stmt = gimple_build_switch_vec (vmain, u, label_vec);
|
stmt = gimple_build_switch_vec (vmain, u, label_vec);
|
||||||
|
|
|
@ -1340,9 +1340,9 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
|
||||||
fallthru_index));
|
fallthru_index));
|
||||||
gimple_seq_add_stmt (&tf->top_p_seq, x);
|
gimple_seq_add_stmt (&tf->top_p_seq, x);
|
||||||
|
|
||||||
last_case = build3 (CASE_LABEL_EXPR, void_type_node,
|
tmp = build_int_cst (integer_type_node, fallthru_index);
|
||||||
build_int_cst (integer_type_node, fallthru_index),
|
last_case = build_case_label (tmp, NULL,
|
||||||
NULL, create_artificial_label (tf_loc));
|
create_artificial_label (tf_loc));
|
||||||
VEC_quick_push (tree, case_label_vec, last_case);
|
VEC_quick_push (tree, case_label_vec, last_case);
|
||||||
last_case_index++;
|
last_case_index++;
|
||||||
|
|
||||||
|
@ -1365,9 +1365,9 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
|
||||||
x = gimple_build_goto (finally_label);
|
x = gimple_build_goto (finally_label);
|
||||||
gimple_seq_add_stmt (&eh_seq, x);
|
gimple_seq_add_stmt (&eh_seq, x);
|
||||||
|
|
||||||
last_case = build3 (CASE_LABEL_EXPR, void_type_node,
|
tmp = build_int_cst (integer_type_node, eh_index);
|
||||||
build_int_cst (integer_type_node, eh_index),
|
last_case = build_case_label (tmp, NULL,
|
||||||
NULL, create_artificial_label (tf_loc));
|
create_artificial_label (tf_loc));
|
||||||
VEC_quick_push (tree, case_label_vec, last_case);
|
VEC_quick_push (tree, case_label_vec, last_case);
|
||||||
last_case_index++;
|
last_case_index++;
|
||||||
|
|
||||||
|
@ -1419,9 +1419,9 @@ lower_try_finally_switch (struct leh_state *state, struct leh_tf_state *tf)
|
||||||
{
|
{
|
||||||
tree case_lab;
|
tree case_lab;
|
||||||
void **slot;
|
void **slot;
|
||||||
case_lab = build3 (CASE_LABEL_EXPR, void_type_node,
|
tmp = build_int_cst (integer_type_node, switch_id);
|
||||||
build_int_cst (integer_type_node, switch_id),
|
case_lab = build_case_label (tmp, NULL,
|
||||||
NULL, create_artificial_label (tf_loc));
|
create_artificial_label (tf_loc));
|
||||||
/* We store the cont_stmt in the pointer map, so that we can recover
|
/* We store the cont_stmt in the pointer map, so that we can recover
|
||||||
it in the loop below. */
|
it in the loop below. */
|
||||||
if (!cont_map)
|
if (!cont_map)
|
||||||
|
@ -3132,8 +3132,8 @@ lower_eh_dispatch (basic_block src, gimple stmt)
|
||||||
blocks at the end of this pass. */
|
blocks at the end of this pass. */
|
||||||
if (! pointer_set_contains (seen_values, TREE_VALUE (flt_node)))
|
if (! pointer_set_contains (seen_values, TREE_VALUE (flt_node)))
|
||||||
{
|
{
|
||||||
tree t = build3 (CASE_LABEL_EXPR, void_type_node,
|
tree t = build_case_label (TREE_VALUE (flt_node),
|
||||||
TREE_VALUE (flt_node), NULL, lab);
|
NULL, lab);
|
||||||
VEC_safe_push (tree, heap, labels, t);
|
VEC_safe_push (tree, heap, labels, t);
|
||||||
pointer_set_insert (seen_values, TREE_VALUE (flt_node));
|
pointer_set_insert (seen_values, TREE_VALUE (flt_node));
|
||||||
have_label = true;
|
have_label = true;
|
||||||
|
@ -3181,8 +3181,7 @@ lower_eh_dispatch (basic_block src, gimple stmt)
|
||||||
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
|
gsi_insert_before (&gsi, x, GSI_SAME_STMT);
|
||||||
|
|
||||||
/* Turn the default label into a default case. */
|
/* Turn the default label into a default case. */
|
||||||
default_label = build3 (CASE_LABEL_EXPR, void_type_node,
|
default_label = build_case_label (NULL, NULL, default_label);
|
||||||
NULL, NULL, default_label);
|
|
||||||
sort_case_labels (labels);
|
sort_case_labels (labels);
|
||||||
|
|
||||||
x = gimple_build_switch_vec (filter, default_label, labels);
|
x = gimple_build_switch_vec (filter, default_label, labels);
|
||||||
|
|
17
gcc/tree.c
17
gcc/tree.c
|
@ -1653,6 +1653,23 @@ make_tree_binfo_stat (unsigned base_binfos MEM_STAT_DECL)
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Create a CASE_LABEL_EXPR tree node and return it. */
|
||||||
|
|
||||||
|
tree
|
||||||
|
build_case_label (tree low_value, tree high_value, tree label_decl)
|
||||||
|
{
|
||||||
|
tree t = make_node (CASE_LABEL_EXPR);
|
||||||
|
|
||||||
|
TREE_TYPE (t) = void_type_node;
|
||||||
|
SET_EXPR_LOCATION (t, DECL_SOURCE_LOCATION (label_decl));
|
||||||
|
|
||||||
|
CASE_LOW (t) = low_value;
|
||||||
|
CASE_HIGH (t) = high_value;
|
||||||
|
CASE_LABEL (t) = label_decl;
|
||||||
|
CASE_CHAIN (t) = NULL_TREE;
|
||||||
|
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
/* Build a newly constructed TREE_VEC node of length LEN. */
|
/* Build a newly constructed TREE_VEC node of length LEN. */
|
||||||
|
|
||||||
|
|
|
@ -4036,6 +4036,10 @@ extern tree copy_node_stat (tree MEM_STAT_DECL);
|
||||||
|
|
||||||
extern tree copy_list (tree);
|
extern tree copy_list (tree);
|
||||||
|
|
||||||
|
/* Make a CASE_LABEL_EXPR. */
|
||||||
|
|
||||||
|
extern tree build_case_label (tree, tree, tree);
|
||||||
|
|
||||||
/* Make a BINFO. */
|
/* Make a BINFO. */
|
||||||
extern tree make_tree_binfo_stat (unsigned MEM_STAT_DECL);
|
extern tree make_tree_binfo_stat (unsigned MEM_STAT_DECL);
|
||||||
#define make_tree_binfo(t) make_tree_binfo_stat (t MEM_STAT_INFO)
|
#define make_tree_binfo(t) make_tree_binfo_stat (t MEM_STAT_INFO)
|
||||||
|
|
Loading…
Reference in New Issue