From 3d528853ba1106b3cbd6eca4316ab2825416b9a6 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Fri, 6 May 2011 03:47:57 +0000 Subject: 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 --- gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/trans.c | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/ada') diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 922460c..18c56d0 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 2011-05-05 Nathan Froyd + * gcc-interface/trans.c (Case_Statement_to_gnu): Call + build_case_label. + +2011-05-05 Nathan Froyd + * gcc-interface/decl.c (intrin_arglists_compatible_p): Use iterators instead of accessing TYPE_ARG_TYPES directly. * gcc-interface/utils.c (handle_nonnull_attribute): Likewise. diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 06b778b..dc79c6f 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -2028,9 +2028,8 @@ Case_Statement_to_gnu (Node_Id gnat_node) if ((!gnu_low || TREE_CODE (gnu_low) == INTEGER_CST) && (!gnu_high || TREE_CODE (gnu_high) == INTEGER_CST)) { - add_stmt_with_node (build3 - (CASE_LABEL_EXPR, void_type_node, - gnu_low, gnu_high, + add_stmt_with_node (build_case_label + (gnu_low, gnu_high, create_artificial_label (input_location)), gnat_choice); choices_added_p = true; -- cgit v1.1