X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=gcc%2Fc-common.c;h=050a1eb979149187d9f3efa60649c1020833ee4d;hb=e7911019b785da4b45f6ed37b7b03227afa38661;hp=f68c8532ebe87b76354d95f45bde066a9fd2f2b1;hpb=88dbf20f7cbfc296419f03e500ea15fd2161ded7;p=pf3gnuchains%2Fgcc-fork.git diff --git a/gcc/c-common.c b/gcc/c-common.c index f68c8532ebe..050a1eb9791 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -3708,11 +3708,16 @@ match_case_to_enum (splay_tree_node node, void *data) return 0; } -/* Common code for -Wswitch*. */ +/* Handle -Wswitch*. Called from the front end after parsing the + switch construct. */ +/* ??? Should probably be somewhere generic, since other languages + besides C and C++ would want this. At the moment, however, C/C++ + are the only tree-ssa languages that support enumerations at all, + so the point is moot. */ -static void -c_do_switch_warnings_1 (splay_tree cases, location_t switch_location, - tree type, tree cond) +void +c_do_switch_warnings (splay_tree cases, location_t switch_location, + tree type, tree cond) { splay_tree_node default_node; @@ -3773,45 +3778,6 @@ c_do_switch_warnings_1 (splay_tree cases, location_t switch_location, } } -/* Handle -Wswitch* for a SWITCH_STMT. Called from the front end - after parsing the switch construct. */ -/* ??? Should probably be somewhere generic, since other languages besides - C and C++ would want this. We'd want to agree on the data structure, - however, which is a problem. Alternately, we operate on gimplified - switch_exprs, which I don't especially like. At the moment, however, - C/C++ are the only tree-ssa languages that support enumerations at all, - so the point is moot. */ - -void -c_do_switch_warnings (splay_tree cases, tree switch_stmt) -{ - location_t switch_location; - - if (EXPR_HAS_LOCATION (switch_stmt)) - switch_location = EXPR_LOCATION (switch_stmt); - else - switch_location = input_location; - c_do_switch_warnings_1 (cases, switch_location, - SWITCH_STMT_TYPE (switch_stmt), - SWITCH_STMT_COND (switch_stmt)); -} - -/* Like c_do_switch_warnings, but takes a SWITCH_EXPR rather than a - SWITCH_STMT. */ - -void -c_do_switch_expr_warnings (splay_tree cases, tree switch_expr) -{ - location_t switch_location; - - if (EXPR_HAS_LOCATION (switch_expr)) - switch_location = EXPR_LOCATION (switch_expr); - else - switch_location = input_location; - c_do_switch_warnings_1 (cases, switch_location, TREE_TYPE (switch_expr), - SWITCH_COND (switch_expr)); -} - /* Finish an expression taking the address of LABEL (an IDENTIFIER_NODE). Returns an expression for the address. */