gcc/gcc ChangeLog c-decl.c c-parse.in c-tree.h ...
zack@gcc.gnu.org
zack@gcc.gnu.org
Sat Jul 19 23:32:00 GMT 2003
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: zack@gcc.gnu.org 2003-07-19 23:32:55
Modified files:
gcc : ChangeLog c-decl.c c-parse.in c-tree.h
gcc/doc : extend.texi
gcc/testsuite : ChangeLog
gcc/testsuite/gcc.dg/noncompile: label-lineno-1.c
Added files:
gcc/testsuite/gcc.dg/noncompile: label-1.c
Log message:
* c-decl.c (named_labels, shadowed_labels, label_level_chain)
(push_label_level, pop_label_level): Kill.
(struct binding_level): Rename level_chain to outer.
Add outer_function field. Change parm_flag, function_body,
keep, keep_if_subblocks to 1-bit bitfields of type bool.
(current_function_level): New variable.
(keep_next_level_flag, keep_next_if_subblocks): Change type to bool.
(keep_next_level, declare_parm_level, warn_if_shadowing):
Update to match.
(struct language_function): Kill named_labels, shadowed_labels fields.
(c_init_decl_processing, start_function, c_push__function_context)
(c_pop_function_context): No need to muck with named_labels nor
shadowed_labels.
(make_binding_level): No need to clear the structure here.
(pop_binding_level): Always operate on current_binding_level.
Update current_function_level if necessary.
(pushlevel): Don't clear named_labels. Update current_function_level
if necessary. Use "true" and "false" where appropriate.
(poplevel): Diagnose labels defined but not used, or vice
versa, and clear out label-meanings leaving scope, while
walking down the decls list, for all binding levels.
Handle LABEL_DECLs appearing in the shadowed list.
pop_binding_level takes no arguments.
(pushdecl_function_level): Use current_function_level.
(make_label, bind_label): New static functions.
(declare_label): New exported function.
(lookup_label, define_label): Rewritten for new data structure.
(shadow_label): Kill.
* c-tree.h: Prototype declare_label; don't prototype
push_label_level, pop_label_level, nor shadow_label.
* c-parse.in: Remove all calls to push_label_level and
pop_label_level. Use declare_label for __label__ decls.
* doc/extend.texi: Clarify that __label__ can be used to
declare labels with local scope in any nested block, not
just statement expressions. Cross-reference nested functions
section from local labels section.
testsuite:
* gcc.dg/noncompile/label-1.c: New comprehensive test case for
diagnostics of ill-formed constructs involving labels.
* gcc.dg/noncompile/label-lineno-1.c: Add error regexp for
the new 'previously defined here' message.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.572&r2=2.573
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-decl.c.diff?cvsroot=gcc&r1=1.410&r2=1.411
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-parse.in.diff?cvsroot=gcc&r1=1.174&r2=1.175
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/c-tree.h.diff?cvsroot=gcc&r1=1.122&r2=1.123
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/extend.texi.diff?cvsroot=gcc&r1=1.148&r2=1.149
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2899&r2=1.2900
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/noncompile/label-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/noncompile/label-lineno-1.c.diff?cvsroot=gcc&r1=1.2&r2=1.3
More information about the Gcc-cvs
mailing list