summaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-26 23:51:14 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-08-26 23:51:14 +0000
commit359d87c692e1b327e950e62d1a90034eb5de7d14 (patch)
tree69dba2343ca72d778fac60a1c90248608167d71f /gcc/tree.h
parentaa89df21c8136a9588e64ab57aa08ced53d6b414 (diff)
downloadgcc-359d87c692e1b327e950e62d1a90034eb5de7d14.tar.gz
* tree.h (CASE_LOW_SEEN, CASE_HIGH_SEEN): New macros for manipulating
temporary visit flags on CASE_LABEL_EXPRs. * c-common.c (match_case_to_enum): Add function comment. Avoid O(N) loop, by looking up both CASE_LOW_SEEN and CASE_HIGH_SEEN. (c_do_switch_warnings): Reorganize to record CASE_LOW_SEEN and CASE_HIGH_SEEN for enumerated types. If the switch expression is a constant, only warn if that constant value isn't handled. * gcc.dg/Wswitch-enum-2.c: New test case. * gcc.dg/Wswitch-enum-3.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116481 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 5e47dacc56d..72a8e46bd03 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -395,6 +395,7 @@ struct tree_common GTY(())
In a STMT_EXPR, it means we want the result of the enclosed
expression.
CALL_EXPR_TAILCALL in CALL_EXPR
+ CASE_LOW_SEEN in CASE_LABEL_EXPR
static_flag:
@@ -413,6 +414,7 @@ struct tree_common GTY(())
EH_FILTER_MUST_NOT_THROW in EH_FILTER_EXPR
TYPE_REF_CAN_ALIAS_ALL in
POINTER_TYPE, REFERENCE_TYPE
+ CASE_HIGH_SEEN in CASE_LABEL_EXPR
public_flag:
@@ -1024,6 +1026,11 @@ extern void omp_clause_range_check_failed (const tree, const char *, int,
call optimizations. */
#define CALL_EXPR_TAILCALL(NODE) (CALL_EXPR_CHECK(NODE)->common.addressable_flag)
+/* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
+ CASE_LOW operand has been processed. */
+#define CASE_LOW_SEEN(NODE) \
+ (CASE_LABEL_EXPR_CHECK (NODE)->common.addressable_flag)
+
/* In a VAR_DECL, nonzero means allocate static storage.
In a FUNCTION_DECL, nonzero if function has been defined.
In a CONSTRUCTOR, nonzero means allocate static storage.
@@ -1037,6 +1044,11 @@ extern void omp_clause_range_check_failed (const tree, const char *, int,
of its scope. */
#define CLEANUP_EH_ONLY(NODE) ((NODE)->common.static_flag)
+/* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
+ CASE_HIGH operand has been processed. */
+#define CASE_HIGH_SEEN(NODE) \
+ (CASE_LABEL_EXPR_CHECK (NODE)->common.static_flag)
+
/* In an expr node (usually a conversion) this means the node was made
implicitly and should not lead to any sort of warning. In a decl node,
warnings concerning the decl should be suppressed. This is used at