aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-gcc.cc
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2011-05-06 03:47:57 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2011-05-06 03:47:57 +0000
commit3d528853ba1106b3cbd6eca4316ab2825416b9a6 (patch)
tree039393d181bb08f19b86318385c11bae2f698e2d /gcc/go/go-gcc.cc
parentd7d058c58a02241c63e6c3cc0099bc5d7f68a153 (diff)
downloadgcc-3d528853ba1106b3cbd6eca4316ab2825416b9a6.zip
gcc-3d528853ba1106b3cbd6eca4316ab2825416b9a6.tar.gz
gcc-3d528853ba1106b3cbd6eca4316ab2825416b9a6.tar.bz2
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
Diffstat (limited to 'gcc/go/go-gcc.cc')
-rw-r--r--gcc/go/go-gcc.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index 18c0bba..f5a6fb5 100644
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -835,8 +835,7 @@ Gcc_backend::switch_statement(
? EXPR_LOCATION((*ps)->get_tree())
: UNKNOWN_LOCATION);
tree label = create_artificial_label(loc);
- tree c = build3_loc(loc, CASE_LABEL_EXPR, void_type_node, NULL_TREE,
- NULL_TREE, label);
+ tree c = build_case_label(NULL_TREE, NULL_TREE, label);
append_to_statement_list(c, &stmt_list);
}
else
@@ -850,8 +849,7 @@ Gcc_backend::switch_statement(
return this->error_statement();
source_location loc = EXPR_LOCATION(t);
tree label = create_artificial_label(loc);
- tree c = build3_loc(loc, CASE_LABEL_EXPR, void_type_node,
- (*pcv)->get_tree(), NULL_TREE, label);
+ tree c = build_case_label((*pcv)->get_tree(), NULL_TREE, label);
append_to_statement_list(c, &stmt_list);
}
}