This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFA: C frontend: Generate SWITCH_EXPR rather than SWITCH_STMT
- From: Richard Henderson <rth at redhat dot com>
- To: Ian Lance Taylor <ian at airs dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 4 Apr 2005 17:43:32 -0700
- Subject: Re: PATCH RFA: C frontend: Generate SWITCH_EXPR rather than SWITCH_STMT
- References: <m38y3z6h4z.fsf@gossamer.airs.com>
On Sun, Apr 03, 2005 at 10:59:08AM -0400, Ian Lance Taylor wrote:
> It would also be possible to change the C++ frontend to no longer
> generate these looping constructs, but to emit GENERIC directly.
> However, my present understanding is that the C++ frontend maintainers
> would prefer to continue to generate them. This is evidently not the
> case for the C frontend, which stopped generating them via a patch by
> RTH last June.
Well, it turns out that we might have to revert some of that in
order to properly handle OpenMP. But that's not relevant here.
> * c-typeck.c (struct c_switch): Rename switch_stmt field to
> switch_expr.
> (c_start_case): Build SWITCH_EXPR, not SWITCH_STMT.
> (do_case): Use SWITCH_COND rather than SWITCH_STMT_COND.
> (c_finish_case): Use SWITCH_BODY rather than SWITCH_STMT_BODY.
> Call c_do_switch_expr_warnings rather than c_do_switch_warnings.
> * c-common.c (c_do_switch_warnings_1): New static function broken
> out of c_do_switch_warnings.
> (c_do_switch_warnings): Call c_do_switch_warnings_1.
> (c_do_switch_expr_warnings): New function.
> * c-common.h (c_do_switch_expr_warnings): Declare.
Ok.
r~