This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH RFA: C frontend: Generate SWITCH_EXPR rather than SWITCH_STMT


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]