Commit ac20c67a by Gabriel Dos Reis Committed by Gabriel Dos Reis

cp-tree.h (scope_kind): Add new enumerator.

	* cp-tree.h (scope_kind): Add new enumerator.
	(keep_next_level): Change parameter type to bool.
	(begin_scope):  Change prototype.
	(pushlevel): Remove declaration.
	* decl.c (push_binding_level): Fold in begin_scope.  Remove.
	(struct cp_binding_level): Remove tag_tranparent field.  Make keep
	of bitsize one.
	(keep_next_level_flag): Make a bool.
	(cxx_scope_descriptor): Update scope names table
	(make_cxx_scope): Fold in begin_scope.  Remove..
	(namespace_scope_ht_size): New function.
	(begin_scope): Change prototype.  Return a scope.  Tidy.
	(kept_level_p): Update.
	(pushlevel): Remove.
	(maybe_push_cleanup_level): Simplify.
	(poplevel): Update for sk_cleanup and keep change.
	(print_binding_level): Likewise.
	(initial_push_namespace_scope): Fold in begin_scope.  Remove.
	(push_namespace): Update.
	(pushtag): Likewise.
	(lookup_tag): Likewise.
	(lookup_name_current_level): Likewise.
	(lookup_type_current_level): Likewise.
	(cxx_init_decl_processing): Likewise.
	(start_function): Likewise.
	(begin_function_body): Likewise.
	(start_method): Likewise.
	* pt.c (push_inline_template_parms_recursive): Likewise.
	(begin_template_parm_list): Likewise.
	(begin_specialization): Likewise.
	* semantics.c (do_pushlevel): Likewise.
	(begin_compound_stmt): Likewise.
	(begin_stmt_expr): Likewise.

From-SVN: r71683
parent 3504b199
2003-09-22 Gabriel Dos Reis <gcc@integrable-solutions.net>
* cp-tree.h (scope_kind): Add new enumerator.
(keep_next_level): Change parameter type to bool.
(begin_scope): Change prototype.
(pushlevel): Remove declaration.
* decl.c (push_binding_level): Fold in begin_scope. Remove.
(struct cp_binding_level): Remove tag_tranparent field. Make keep
of bitsize one.
(keep_next_level_flag): Make a bool.
(cxx_scope_descriptor): Update scope names table
(make_cxx_scope): Fold in begin_scope. Remove..
(namespace_scope_ht_size): New function.
(begin_scope): Change prototype. Return a scope. Tidy.
(kept_level_p): Update.
(pushlevel): Remove.
(maybe_push_cleanup_level): Simplify.
(poplevel): Update for sk_cleanup and keep change.
(print_binding_level): Likewise.
(initial_push_namespace_scope): Fold in begin_scope. Remove.
(push_namespace): Update.
(pushtag): Likewise.
(lookup_tag): Likewise.
(lookup_name_current_level): Likewise.
(lookup_type_current_level): Likewise.
(cxx_init_decl_processing): Likewise.
(start_function): Likewise.
(begin_function_body): Likewise.
(start_method): Likewise.
* pt.c (push_inline_template_parms_recursive): Likewise.
(begin_template_parm_list): Likewise.
(begin_specialization): Likewise.
* semantics.c (do_pushlevel): Likewise.
(begin_compound_stmt): Likewise.
(begin_stmt_expr): Likewise.
2003-09-21 Richard Henderson <rth@redhat.com> 2003-09-21 Richard Henderson <rth@redhat.com>
* class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c, * class.c, cp-tree.h, decl.c, decl2.c, error.c, init.c,
......
...@@ -2935,6 +2935,9 @@ typedef enum scope_kind { ...@@ -2935,6 +2935,9 @@ typedef enum scope_kind {
is initialized by using "memset" to set the is initialized by using "memset" to set the
contents to zero, and the default scope kind contents to zero, and the default scope kind
is "sk_block". */ is "sk_block". */
sk_cleanup, /* A scope for (pseudo-)scope for cleanup. It is
peusdo in that it is transparent to name lookup
activities. */
sk_try, /* A try-block. */ sk_try, /* A try-block. */
sk_catch, /* A catch-block. */ sk_catch, /* A catch-block. */
sk_for, /* The scope of the variable declared in a sk_for, /* The scope of the variable declared in a
...@@ -3609,7 +3612,6 @@ extern void adjust_clone_args (tree); ...@@ -3609,7 +3612,6 @@ extern void adjust_clone_args (tree);
extern int global_bindings_p (void); extern int global_bindings_p (void);
extern int kept_level_p (void); extern int kept_level_p (void);
extern tree getdecls (void); extern tree getdecls (void);
extern void pushlevel (int);
extern void insert_block (tree); extern void insert_block (tree);
extern void set_block (tree); extern void set_block (tree);
extern tree pushdecl (tree); extern tree pushdecl (tree);
...@@ -3622,12 +3624,12 @@ extern void cxx_pop_function_context (struct function *); ...@@ -3622,12 +3624,12 @@ extern void cxx_pop_function_context (struct function *);
extern void cxx_mark_function_context (struct function *); extern void cxx_mark_function_context (struct function *);
extern int toplevel_bindings_p (void); extern int toplevel_bindings_p (void);
extern int namespace_bindings_p (void); extern int namespace_bindings_p (void);
extern void keep_next_level (int); extern void keep_next_level (bool);
extern scope_kind innermost_scope_kind (void); extern scope_kind innermost_scope_kind (void);
extern int template_parm_scope_p (void); extern int template_parm_scope_p (void);
extern void set_class_shadows (tree); extern void set_class_shadows (tree);
extern void maybe_push_cleanup_level (tree); extern void maybe_push_cleanup_level (tree);
extern void begin_scope (scope_kind); extern cxx_scope *begin_scope (scope_kind, tree);
extern void finish_scope (void); extern void finish_scope (void);
extern void resume_level (struct cp_binding_level *); extern void resume_level (struct cp_binding_level *);
extern void delete_block (tree); extern void delete_block (tree);
......
...@@ -352,7 +352,8 @@ push_inline_template_parms_recursive (tree parmlist, int levels) ...@@ -352,7 +352,8 @@ push_inline_template_parms_recursive (tree parmlist, int levels)
parms, current_template_parms); parms, current_template_parms);
TEMPLATE_PARMS_FOR_INLINE (current_template_parms) = 1; TEMPLATE_PARMS_FOR_INLINE (current_template_parms) = 1;
pushlevel (0); begin_scope (TREE_VEC_LENGTH (parms) ? sk_template_parms : sk_template_spec,
NULL);
for (i = 0; i < TREE_VEC_LENGTH (parms); ++i) for (i = 0; i < TREE_VEC_LENGTH (parms); ++i)
{ {
tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i)); tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i));
...@@ -609,7 +610,7 @@ begin_template_parm_list (void) ...@@ -609,7 +610,7 @@ begin_template_parm_list (void)
pushtag contains special code to call pushdecl_with_scope on the pushtag contains special code to call pushdecl_with_scope on the
TEMPLATE_DECL for S2. */ TEMPLATE_DECL for S2. */
begin_scope (sk_template_parms); begin_scope (sk_template_parms, NULL);
++processing_template_decl; ++processing_template_decl;
++processing_template_parmlist; ++processing_template_parmlist;
note_template_header (0); note_template_header (0);
...@@ -653,7 +654,7 @@ check_specialization_scope (void) ...@@ -653,7 +654,7 @@ check_specialization_scope (void)
void void
begin_specialization (void) begin_specialization (void)
{ {
begin_scope (sk_template_spec); begin_scope (sk_template_spec, NULL);
note_template_header (1); note_template_header (1);
check_specialization_scope (); check_specialization_scope ();
} }
......
...@@ -360,7 +360,7 @@ do_pushlevel (scope_kind sk) ...@@ -360,7 +360,7 @@ do_pushlevel (scope_kind sk)
{ {
if (!processing_template_decl) if (!processing_template_decl)
add_scope_stmt (/*begin_p=*/1, /*partial_p=*/0); add_scope_stmt (/*begin_p=*/1, /*partial_p=*/0);
begin_scope (sk); begin_scope (sk, NULL);
} }
} }
...@@ -1004,7 +1004,7 @@ begin_compound_stmt (bool has_no_scope) ...@@ -1004,7 +1004,7 @@ begin_compound_stmt (bool has_no_scope)
statement-expression. But, if it's a statement-expression with statement-expression. But, if it's a statement-expression with
a scopeless block, there's nothing to keep, and we don't want a scopeless block, there's nothing to keep, and we don't want
to accidentally keep a block *inside* the scopeless block. */ to accidentally keep a block *inside* the scopeless block. */
keep_next_level (0); keep_next_level (false);
return r; return r;
} }
...@@ -1408,7 +1408,7 @@ begin_stmt_expr (void) ...@@ -1408,7 +1408,7 @@ begin_stmt_expr (void)
last_expr_type = NULL_TREE; last_expr_type = NULL_TREE;
keep_next_level (1); keep_next_level (true);
return last_tree; return last_tree;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment