diff options
author | Tom Tromey <tromey@redhat.com> | 2001-12-11 03:29:12 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2001-12-11 03:29:12 +0000 |
commit | 3afdfae81c8c771c6c949d2c2a93283a30b25a6f (patch) | |
tree | 2a3012e2aeef75fd78877402835149722fd38a67 /gcc/java/check-init.c | |
parent | d7a5e25326eed7235ba55b55c3a7ff5050f8ed7f (diff) | |
download | gcc-3afdfae81c8c771c6c949d2c2a93283a30b25a6f.zip gcc-3afdfae81c8c771c6c949d2c2a93283a30b25a6f.tar.gz gcc-3afdfae81c8c771c6c949d2c2a93283a30b25a6f.tar.bz2 |
* check-init.c (check_init) [SWITCH_EXPR]: Use SWITCH_HAS_DEFAULT.
From-SVN: r47860
Diffstat (limited to 'gcc/java/check-init.c')
-rw-r--r-- | gcc/java/check-init.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/gcc/java/check-init.c b/gcc/java/check-init.c index 4b1ab98..2a4e3c3 100644 --- a/gcc/java/check-init.c +++ b/gcc/java/check-init.c @@ -429,9 +429,6 @@ struct alternatives struct alternatives * alternatives = NULL; -/* True if we've seen a DEFAULT_EXPR for the current SWITCH_EXPR. */ -static int current_switch_has_default; - /* Begin handling a control flow branch. BEFORE is the state of [un]assigned variables on entry. CURRENT is a struct alt to manage the branch alternatives. */ @@ -689,9 +686,7 @@ check_init (exp, before) case SWITCH_EXPR: { struct alternatives alt; - int saved_current_switch_has_default = current_switch_has_default; word buf[2]; - current_switch_has_default = 0; check_init (TREE_OPERAND (exp, 0), before); BEGIN_ALTERNATIVES (before, alt); alt.saved = ALLOC_BUFFER(buf, num_current_words); @@ -699,19 +694,14 @@ check_init (exp, before) alt.block = exp; check_init (TREE_OPERAND (exp, 1), before); done_alternative (before, &alt); - if (! current_switch_has_default) - { - done_alternative (alt.saved, &alt); - } + if (! SWITCH_HAS_DEFAULT (exp)) + done_alternative (alt.saved, &alt); FREE_BUFFER(alt.saved, buf); END_ALTERNATIVES (before, alt); - current_switch_has_default = saved_current_switch_has_default; return; } - case DEFAULT_EXPR: - current_switch_has_default = 1; - /* .. then fall through ... */ case CASE_EXPR: + case DEFAULT_EXPR: { int i; struct alternatives *alt = alternatives; |