diff options
author | Steven Bosscher <steven@gcc.gnu.org> | 2012-09-04 13:03:02 +0000 |
---|---|---|
committer | Steven Bosscher <steven@gcc.gnu.org> | 2012-09-04 13:03:02 +0000 |
commit | fd8d363e257e2a8c9a22fcc276421bec68e1bb94 (patch) | |
tree | e122d3a36874476f12e63764b611e6ee436001d2 /gcc/tree-switch-conversion.c | |
parent | b8db7f86fd47dcae8e559b990816243f27ade021 (diff) | |
download | gcc-fd8d363e257e2a8c9a22fcc276421bec68e1bb94.zip gcc-fd8d363e257e2a8c9a22fcc276421bec68e1bb94.tar.gz gcc-fd8d363e257e2a8c9a22fcc276421bec68e1bb94.tar.bz2 |
gimple.h (gimple_build_switch): Remove.
* 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.
From-SVN: r190925
Diffstat (limited to 'gcc/tree-switch-conversion.c')
-rw-r--r-- | gcc/tree-switch-conversion.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c index df88ddf..87baefc 100644 --- a/gcc/tree-switch-conversion.c +++ b/gcc/tree-switch-conversion.c @@ -318,7 +318,7 @@ emit_case_bit_tests (gimple swtch, tree index_expr, memset (&test, 0, sizeof (test)); /* Get the edge for the default case. */ - tmp = gimple_switch_label (swtch, 0); + tmp = gimple_switch_default_label (swtch); default_bb = label_to_block (CASE_LABEL (tmp)); default_edge = find_edge (switch_bb, default_bb); @@ -612,14 +612,12 @@ collect_switch_conv_info (gimple swtch, struct switch_conv_info *info) memset (info, 0, sizeof (*info)); /* The gimplifier has already sorted the cases by CASE_LOW and ensured there - is a default label which is the first in the vector. */ - gcc_assert (CASE_LOW (gimple_switch_label (swtch, 0)) == NULL_TREE); - - /* Collect the bits we can deduce from the CFG. */ + is a default label which is the first in the vector. + Collect the bits we can deduce from the CFG. */ info->index_expr = gimple_switch_index (swtch); info->switch_bb = gimple_bb (swtch); info->default_bb = - label_to_block (CASE_LABEL (gimple_switch_label (swtch, 0))); + label_to_block (CASE_LABEL (gimple_switch_default_label (swtch))); e_default = find_edge (info->switch_bb, info->default_bb); info->default_prob = e_default->probability; info->default_count = e_default->count; @@ -1393,7 +1391,7 @@ process_switch (gimple swtch) transformation. */ create_temp_arrays (&info); - gather_default_values (gimple_switch_label (swtch, 0), &info); + gather_default_values (gimple_switch_default_label (swtch), &info); build_constructors (swtch, &info); build_arrays (swtch, &info); /* Build the static arrays and assignments. */ |