summaryrefslogtreecommitdiff
path: root/gcc/c-common.def
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-04 22:05:15 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-04 22:05:15 +0000
commit79dc3b8eebe13e6e2cd6d8813aeaaa4171e307b2 (patch)
treeabbbeb9e68d3bc70e43d55d15b23db2b78adbf38 /gcc/c-common.def
parent5c56a3a9aa6da6b2b1e51b4dcbc2745cd77ef44b (diff)
downloadgcc-79dc3b8eebe13e6e2cd6d8813aeaaa4171e307b2.tar.gz
PR c/4475, c++/3780:
* c-common.def (SWITCH_STMT): Add SWITCH_TYPE operand. * c-common.h (SWITCH_TYPE): Define. * c-typeck.c (c_start_case): Set SWITCH_TYPE. * stmt.c (all_cases_count): Set lastval to thisval at end of loop. Rename spareness variable to sparseness. (expand_end_case_type): Renamed from expand_end_case, use orig_type if non-NULL instead of TREE_TYPE (orig_index). * tree.h (expand_end_case_type): Renamed from expand_end_case. (expand_end_case): Define using expand_end_case_type. * c-semantics.c (genrtl_switch_stmt): Pass SWITCH_TYPE to expand_end_case_type. * doc/c-tree.texi (SWITCH_STMT): Document SWITCH_TYPE. * semantics.c (begin_switch_stmt): Clear SWITCH_TYPE. (finish_switch_cond): Set SWITCH_TYPE. * gcc.dg/Wswitch.c: Fix typos. Don't return unconditionally before all tests. Move warning one line above to match where it C frontend emits. * gcc.dg/Wswitch-2.c: New test. * g++.dg/warn/Wswitch-1.C: New test. * g++.dg/warn/Wswitch-2.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49497 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-common.def')
-rw-r--r--gcc/c-common.def4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/c-common.def b/gcc/c-common.def
index d59a151680e..293f4b21bd3 100644
--- a/gcc/c-common.def
+++ b/gcc/c-common.def
@@ -71,8 +71,8 @@ DEFTREECODE (BREAK_STMT, "break_stmt", 'e', 0)
DEFTREECODE (CONTINUE_STMT, "continue_stmt", 'e', 0)
/* Used to represent a 'switch' statement. The operands are
- SWITCH_COND and SWITCH_BODY, respectively. */
-DEFTREECODE (SWITCH_STMT, "switch_stmt", 'e', 2)
+ SWITCH_COND, SWITCH_BODY and SWITCH_TYPE, respectively. */
+DEFTREECODE (SWITCH_STMT, "switch_stmt", 'e', 3)
/* Used to represent a 'goto' statement. The operand is GOTO_DESTINATION. */
DEFTREECODE (GOTO_STMT, "goto_stmt", 'e', 1)