From b6e3dd65e22ef968bdc50ca35709439b3487e383 Mon Sep 17 00:00:00 2001 From: froydnj Date: Fri, 6 May 2011 03:47:57 +0000 Subject: 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173467 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/gimplify.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gcc/gimplify.c') diff --git a/gcc/gimplify.c b/gcc/gimplify.c index c4b84c17198..700aa238e69 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -1584,10 +1584,11 @@ gimplify_switch_expr (tree *expr_p, gimple_seq *pre_p) break; } if (i == len) - default_case = build3 (CASE_LABEL_EXPR, void_type_node, - NULL_TREE, NULL_TREE, - CASE_LABEL (VEC_index (tree, - labels, 0))); + { + tree label = CASE_LABEL (VEC_index (tree, labels, 0)); + default_case = build_case_label (NULL_TREE, NULL_TREE, + label); + } } } @@ -1596,9 +1597,8 @@ gimplify_switch_expr (tree *expr_p, gimple_seq *pre_p) gimple new_default; default_case - = build3 (CASE_LABEL_EXPR, void_type_node, - NULL_TREE, NULL_TREE, - create_artificial_label (UNKNOWN_LOCATION)); + = build_case_label (NULL_TREE, NULL_TREE, + create_artificial_label (UNKNOWN_LOCATION)); new_default = gimple_build_label (CASE_LABEL (default_case)); gimplify_seq_add_stmt (&switch_body_seq, new_default); } -- cgit v1.2.1