cp-tree.def (LABEL_STMT): New tree node.

* cp-tree.def (LABEL_STMT): New tree node.
	(LABEL_STMT_LABEL): New macro.
	(shadow_label): Remove.
	(declare_local_label): New function.
	(finish_label_decl): Likewise.
	* decl.c (make_label_decl): New function, split out from
	lookup_label.
	(shadowed_labels): Remove.
	(binding_level): Add shadowed_labels.
	(clear_binding_level): Remove.
	(push_binding_level): Just bzero the new binding level.
	(pushlevel): Fix indentation.
	(pop_label): New function.
	(pop_labels): Likewise, split out from poplevel.
	(poplevel): Pop local labels.  Use pop_labels.
	(maybe_push_to_top_level): Don't clear shadowed_labels.
	(lookup_label): Use make_label_decl.
	(shadow_label): Remove.
	(declare_local_label): New function.
	(define_label): Simplify.
	(start_function): Don't clear shadowed_labels.
	(cp_function): Remove shadowed_labels.
	(push_cp_function_context): Don't save shadowed_labels.
	(pop_cp_function_context): Don't restore it.
	* dump.c (dequeue_and_dump): Handle LABEL_STMT.
	* parse.y (label_decl): Use finish_label_decl.
	* pt.c (tsubst_expr): Handle LABEL_STMTs, and local label
	declarations.
	* semantics.c (finish_label_stmt): Add a LABEL_STMT when
	building_stmt_tree.
	(finish_label_decl): New function.
	(expand_stmt): Handle LABEL_STMTs and local label declarations.

From-SVN: r28950
This commit is contained in:
Mark Mitchell 1999-08-29 00:51:31 +00:00
parent 5aabad0023
commit b5434ee085

View File

@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA. */
DELETE_EXPR_USE_VEC (in DELETE_EXPR).
(TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out).
TYPE_USES_COMPLEX_INHERITANCE (in _TYPE).
C_DECLARED_LABEL_FLAG.
C_DECLARED_LABEL_FLAG (in LABEL_DECL)
INHERITED_VALUE_BINDING_P (in CPLUS_BINDING)
BASELINK_P (in TREE_LIST)
ICS_ELLIPSIS_FLAG (in _CONV)
@ -2159,6 +2159,7 @@ extern int flag_new_for_scope;
#define DECL_STMT_DECL(NODE) TREE_OPERAND (NODE, 0)
#define STMT_EXPR_STMT(NODE) TREE_OPERAND (NODE, 0)
#define SUBOBJECT_CLEANUP(NODE) TREE_OPERAND (NODE, 0)
#define LABEL_STMT_LABEL(NODE) TREE_OPERAND (NODE, 0)
/* Nonzero for an ASM_STMT if the assembly statement is volatile. */
#define ASM_VOLATILE_P(NODE) \
@ -2894,7 +2895,7 @@ extern tree push_using_directive PROTO((tree));
extern void push_class_level_binding PROTO((tree, tree));
extern tree implicitly_declare PROTO((tree));
extern tree lookup_label PROTO((tree));
extern tree shadow_label PROTO((tree));
extern tree declare_local_label PROTO((tree));
extern tree define_label PROTO((char *, int, tree));
extern void push_switch PROTO((void));
extern void pop_switch PROTO((void));
@ -3360,6 +3361,7 @@ extern tree begin_compound_stmt PROTO((int));
extern tree finish_compound_stmt PROTO((int, tree));
extern void finish_asm_stmt PROTO((tree, tree, tree, tree, tree));
extern void finish_label_stmt PROTO((tree));
extern void finish_label_decl PROTO((tree));
extern void finish_subobject PROTO((tree));
extern tree finish_parenthesized_expr PROTO((tree));
extern tree begin_stmt_expr PROTO((void));