aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-gimple.c
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb@suse.de>2004-05-26 22:36:49 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2004-05-26 22:36:49 +0000
commitf667741c42d3bc8082877638726e4d3a22285431 (patch)
tree9a721edcedc47294d0570c2ba52be9541243aeec /gcc/tree-gimple.c
parente4efa9715632519e202f57250b3d8954b17ac9c9 (diff)
downloadgcc-f667741c42d3bc8082877638726e4d3a22285431.zip
gcc-f667741c42d3bc8082877638726e4d3a22285431.tar.gz
gcc-f667741c42d3bc8082877638726e4d3a22285431.tar.bz2
gimplify.c (compare_case_labels): New function.
* gimplify.c (compare_case_labels): New function. (gimplify_switch_expr): Sort case labels, and make sure the last label in the label vector is the default case. * tree-cfg.c (group_case_labels): New function. (build_tree_cfg): Cleanup redundant labels and group case labels before creating edges. (cleanup_dead_labels): Handle GOTO_EXPRs. (find_case_label_for_value): Use a binary search to find the case label for the given value. * tree-gimple.c: Mention that labels are sorted, and that the last label must be the default. From-SVN: r82297
Diffstat (limited to 'gcc/tree-gimple.c')
-rw-r--r--gcc/tree-gimple.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/tree-gimple.c b/gcc/tree-gimple.c
index 18bc2f8..e749ec8 100644
--- a/gcc/tree-gimple.c
+++ b/gcc/tree-gimple.c
@@ -73,6 +73,8 @@ Boston, MA 02111-1307, USA. */
op1 -> stmt
op2 -> array of case labels (as LABEL_DECLs?)
FIXME: add case value info
+ The SWITCH_LABELS (op2) are sorted in ascending order, and the
+ last label in the vector is always the default case.
jump-stmt:
GOTO_EXPR
op0 -> LABEL_DECL | '*' ID