aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple.h
diff options
context:
space:
mode:
authorSteven Bosscher <steven@gcc.gnu.org>2012-09-04 13:03:02 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2012-09-04 13:03:02 +0000
commit7a8ecf31a756b303606bf5925c101651fb128cd0 (patch)
treee122d3a36874476f12e63764b611e6ee436001d2 /gcc/gimple.h
parentf89a442b8017308173b40224ea36b44d9503c736 (diff)
* gimple.h (gimple_build_switch): Remove.
(gimple_build_switch_vec): Promote to the new gimple_build_switch. (gimple_switch_default_label): Assert the default case label is really a default case label. (gimple_switch_set_default_label): Likewise. * gimple.c (gimple_build_switch_nlabels): Make sure a default label is passed in, and simplify accordingly. (gimple_build_switch): Removed. (gimple_build_switch_vec): Rename to gimple_build_switch. * gimplify.c (gimplify_switch_expr): Update gimple_build_switch use. * gimple-pretty-print.c (dump_gimple_switch): Do not accept a NULL case label. * stmt.c (expand_case): Simplify using the fact that every GIMPLE switch must have a default case. * tree-cfg.c (group_case_labels_stmt): Likewise. (verify_gimple_switch): Use gimple_switch_label in verifier to get the label at index 0, and verify that it is a valid default case. * except.c (sjlj_emit_dispatch_table): Rewrite construction of the switch for dispatching. * tree-eh.c (lower_try_finally_switch): Update gimple_build_switch use. (lower_eh_dispatch): Likewise. * tree-vrp.c (execute_vrp): Use gimple_switch_label to get the case label at index 0 before turning it into a default case label. * omp-low.c (expand_omp_sections): Update gimple_build_switch use. * tree-switch-conversion.c (emit_case_bit_tests): Get the default case label using gimple_switch_default_label. (collect_switch_conv_info): Likewise. (process_switch): Likewise. * doc/gimple.texi: Update documentation of gimple_build_switch. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@190925 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.h')
-rw-r--r--gcc/gimple.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/gimple.h b/gcc/gimple.h
index 827103d0eb3..15b597fc187 100644
--- a/gcc/gimple.h
+++ b/gcc/gimple.h
@@ -781,8 +781,7 @@ gimple gimple_build_wce (gimple_seq);
gimple gimple_build_resx (int);
gimple gimple_build_eh_dispatch (int);
gimple gimple_build_switch_nlabels (unsigned, tree, tree);
-gimple gimple_build_switch (unsigned, tree, tree, ...);
-gimple gimple_build_switch_vec (tree, tree, VEC(tree,heap) *);
+gimple gimple_build_switch (tree, tree, VEC(tree,heap) *);
gimple gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
gimple gimple_build_omp_task (gimple_seq, tree, tree, tree, tree, tree, tree);
gimple gimple_build_omp_for (gimple_seq, tree, size_t, gimple_seq);
@@ -3639,7 +3638,9 @@ gimple_switch_set_label (gimple gs, unsigned index, tree label)
static inline tree
gimple_switch_default_label (const_gimple gs)
{
- return gimple_switch_label (gs, 0);
+ tree label = gimple_switch_label (gs, 0);
+ gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
+ return label;
}
/* Set the default label for a switch statement. */
@@ -3647,6 +3648,7 @@ gimple_switch_default_label (const_gimple gs)
static inline void
gimple_switch_set_default_label (gimple gs, tree label)
{
+ gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
gimple_switch_set_label (gs, 0, label);
}