Commit 2c140474 by Diego Novillo Committed by Diego Novillo

name-lookup.h (cp_binding_level): Rename from cxx_scope.

	* name-lookup.h (cp_binding_level): Rename from cxx_scope.
	Update all users.
	(struct cp_binding_level): Fix indentation.

From-SVN: r176218
parent 38ab02db
2011-07-12 Diego Novillo <dnovillo@google.com>
* name-lookup.h (cp_binding_level): Rename from cxx_scope.
Update all users.
(struct cp_binding_level): Fix indentation.
2011-07-11 Jason Merrill <jason@redhat.com>
PR c++/49672
......
......@@ -950,7 +950,7 @@ struct GTY(()) saved_scope {
VEC(tree,gc) *lang_base;
tree lang_name;
tree template_parms;
struct cp_binding_level *x_previous_class_level;
cp_binding_level *x_previous_class_level;
tree x_saved_tree;
/* Only used for uses of this in trailing return type. */
......@@ -967,8 +967,8 @@ struct GTY(()) saved_scope {
struct stmt_tree_s x_stmt_tree;
struct cp_binding_level *class_bindings;
struct cp_binding_level *bindings;
cp_binding_level *class_bindings;
cp_binding_level *bindings;
struct saved_scope *prev;
};
......@@ -1054,7 +1054,7 @@ struct GTY(()) language_function {
BOOL_BITFIELD can_throw : 1;
htab_t GTY((param_is(struct named_label_entry))) x_named_labels;
struct cp_binding_level *bindings;
cp_binding_level *bindings;
VEC(tree,gc) *x_local_names;
htab_t GTY((param_is (struct cxx_int_tree_map))) extern_decl_map;
};
......@@ -1944,7 +1944,7 @@ struct GTY(()) lang_decl_fn {
struct GTY(()) lang_decl_ns {
struct lang_decl_base base;
struct cp_binding_level *level;
cp_binding_level *level;
};
/* DECL_LANG_SPECIFIC for parameters. */
......@@ -4860,7 +4860,7 @@ extern tree make_anon_name (void);
extern tree pushdecl_top_level_maybe_friend (tree, bool);
extern tree pushdecl_top_level_and_finish (tree, tree);
extern tree check_for_out_of_scope_variable (tree);
extern void print_other_binding_stack (struct cp_binding_level *);
extern void print_other_binding_stack (cp_binding_level *);
extern tree maybe_push_decl (tree);
extern tree current_decl_namespace (void);
......
......@@ -184,7 +184,7 @@ struct GTY((chain_next ("%h.next"))) named_label_use_entry {
/* The binding level to which this entry is *currently* attached.
This is initially the binding level in which the goto appeared,
but is modified as scopes are closed. */
struct cp_binding_level *binding_level;
cp_binding_level *binding_level;
/* The head of the names list that was current when the goto appeared,
or the inner scope popped. These are the decls that will *not* be
skipped when jumping to the label. */
......@@ -208,7 +208,7 @@ struct GTY(()) named_label_entry {
/* The binding level to which the label is *currently* attached.
This is initially set to the binding level in which the label
is defined, but is modified as scopes are closed. */
struct cp_binding_level *binding_level;
cp_binding_level *binding_level;
/* The head of the names list that was current when the label was
defined, or the inner scope popped. These are the decls that will
be skipped when jumping to the label. */
......@@ -270,7 +270,7 @@ current_tmpl_spec_kind (int n_class_scopes)
int n_template_parm_scopes = 0;
int seen_specialization_p = 0;
int innermost_specialization_p = 0;
struct cp_binding_level *b;
cp_binding_level *b;
/* Scan through the template parameter scopes. */
for (b = current_binding_level;
......@@ -447,7 +447,7 @@ objc_get_current_scope (void)
void
objc_mark_locals_volatile (void *enclosing_blk)
{
struct cp_binding_level *scope;
cp_binding_level *scope;
for (scope = current_binding_level;
scope && scope != enclosing_blk;
......@@ -470,8 +470,8 @@ static int
poplevel_named_label_1 (void **slot, void *data)
{
struct named_label_entry *ent = (struct named_label_entry *) *slot;
struct cp_binding_level *bl = (struct cp_binding_level *) data;
struct cp_binding_level *obl = bl->level_chain;
cp_binding_level *bl = (cp_binding_level *) data;
cp_binding_level *obl = bl->level_chain;
if (ent->binding_level == bl)
{
......@@ -853,7 +853,7 @@ walk_namespaces (walk_namespaces_fn f, void* data)
int
wrapup_globals_for_namespace (tree name_space, void* data)
{
struct cp_binding_level *level = NAMESPACE_LEVEL (name_space);
cp_binding_level *level = NAMESPACE_LEVEL (name_space);
VEC(tree,gc) *statics = level->static_decls;
tree *vec = VEC_address (tree, statics);
int len = VEC_length (tree, statics);
......@@ -2644,10 +2644,10 @@ identify_goto (tree decl, const location_t *locus)
true if all is well. */
static bool
check_previous_goto_1 (tree decl, struct cp_binding_level* level, tree names,
check_previous_goto_1 (tree decl, cp_binding_level* level, tree names,
bool exited_omp, const location_t *locus)
{
struct cp_binding_level *b;
cp_binding_level *b;
bool identified = false, saw_eh = false, saw_omp = false;
if (exited_omp)
......@@ -2719,7 +2719,7 @@ check_previous_goto (tree decl, struct named_label_use_entry *use)
}
static bool
check_switch_goto (struct cp_binding_level* level)
check_switch_goto (cp_binding_level* level)
{
return check_previous_goto_1 (NULL_TREE, level, level->names, false, NULL);
}
......@@ -2805,7 +2805,7 @@ check_goto (tree decl)
error (" enters OpenMP structured block");
else if (flag_openmp)
{
struct cp_binding_level *b;
cp_binding_level *b;
for (b = current_binding_level; b ; b = b->level_chain)
{
if (b == ent->binding_level)
......@@ -2831,7 +2831,7 @@ check_goto (tree decl)
bool
check_omp_return (void)
{
struct cp_binding_level *b;
cp_binding_level *b;
for (b = current_binding_level; b ; b = b->level_chain)
if (b->kind == sk_omp)
{
......@@ -2850,7 +2850,7 @@ static tree
define_label_1 (location_t location, tree name)
{
struct named_label_entry *ent, dummy;
struct cp_binding_level *p;
cp_binding_level *p;
tree decl;
decl = lookup_label (name);
......@@ -2909,7 +2909,7 @@ define_label (location_t location, tree name)
struct cp_switch
{
struct cp_binding_level *level;
cp_binding_level *level;
struct cp_switch *next;
/* The SWITCH_STMT being built. */
tree switch_stmt;
......@@ -2990,7 +2990,7 @@ tree
finish_case_label (location_t loc, tree low_value, tree high_value)
{
tree cond, r;
struct cp_binding_level *p;
cp_binding_level *p;
tree type;
if (processing_template_decl)
......@@ -3758,7 +3758,7 @@ cp_make_fname_decl (location_t loc, tree id, int type_dep)
if (current_function_decl)
{
struct cp_binding_level *b = current_binding_level;
cp_binding_level *b = current_binding_level;
if (b->kind == sk_function_parms)
return error_mark_node;
while (b->level_chain->kind != sk_function_parms)
......@@ -8499,7 +8499,7 @@ grokdeclarator (const cp_declarator *declarator,
if (decl_context == NORMAL && !toplevel_bindings_p ())
{
struct cp_binding_level *b = current_binding_level;
cp_binding_level *b = current_binding_level;
current_binding_level = b->level_chain;
if (current_binding_level != 0 && toplevel_bindings_p ())
decl_context = PARM;
......@@ -12436,7 +12436,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
tree fntype;
tree restype;
int doing_friend = 0;
struct cp_binding_level *bl;
cp_binding_level *bl;
tree current_function_parms;
struct c_fileinfo *finfo
= get_fileinfo (LOCATION_FILE (DECL_SOURCE_LOCATION (decl1)));
......
......@@ -53,7 +53,7 @@ extern binding_entry binding_table_find (binding_table, tree);
typedef struct cxx_binding cxx_binding;
/* The datatype used to implement C++ scope. */
typedef struct cp_binding_level cxx_scope;
typedef struct cp_binding_level cp_binding_level;
/* Nonzero if this binding is for a local scope, as opposed to a class
or namespace scope. */
......@@ -71,7 +71,7 @@ struct GTY(()) cxx_binding {
/* The type entity this name is bound to. */
tree type;
/* The scope at which this binding was made. */
cxx_scope *scope;
cp_binding_level *scope;
unsigned value_is_inherited : 1;
unsigned is_local : 1;
};
......@@ -185,83 +185,83 @@ DEF_VEC_ALLOC_O(cp_label_binding,gc);
is duplicated in the IDENTIFIER_GLOBAL_VALUEs of all identifiers. */
struct GTY(()) cp_binding_level {
/* A chain of _DECL nodes for all variables, constants, functions,
and typedef types. These are in the reverse of the order
supplied. There may be OVERLOADs on this list, too, but they
are wrapped in TREE_LISTs; the TREE_VALUE is the OVERLOAD. */
tree names;
/* A chain of NAMESPACE_DECL nodes. */
tree namespaces;
/* An array of static functions and variables (for namespaces only) */
VEC(tree,gc) *static_decls;
/* A list of USING_DECL nodes. */
tree usings;
/* A list of used namespaces. PURPOSE is the namespace,
VALUE the common ancestor with this binding_level's namespace. */
tree using_directives;
/* For the binding level corresponding to a class, the entities
declared in the class or its base classes. */
VEC(cp_class_binding,gc) *class_shadowed;
/* Similar to class_shadowed, but for IDENTIFIER_TYPE_VALUE, and
is used for all binding levels. The TREE_PURPOSE is the name of
the entity, the TREE_TYPE is the associated type. In addition
the TREE_VALUE is the IDENTIFIER_TYPE_VALUE before we entered
the class. */
tree type_shadowed;
/* Similar to class_shadowed, but for IDENTIFIER_LABEL_VALUE, and
used for all binding levels. */
VEC(cp_label_binding,gc) *shadowed_labels;
/* For each level (except not the global one),
a chain of BLOCK nodes for all the levels
that were entered and exited one level down. */
tree blocks;
/* The entity (namespace, class, function) the scope of which this
binding contour corresponds to. Otherwise NULL. */
tree this_entity;
/* The binding level which this one is contained in (inherits from). */
struct cp_binding_level *level_chain;
/* List of VAR_DECLS saved from a previous for statement.
These would be dead in ISO-conforming code, but might
be referenced in ARM-era code. */
VEC(tree,gc) *dead_vars_from_for;
/* STATEMENT_LIST for statements in this binding contour.
Only used at present for SK_CLEANUP temporary bindings. */
tree statement_list;
/* Binding depth at which this level began. */
int binding_depth;
/* The kind of scope that this object represents. However, a
SK_TEMPLATE_SPEC scope is represented with KIND set to
SK_TEMPLATE_PARMS and EXPLICIT_SPEC_P set to true. */
ENUM_BITFIELD (scope_kind) kind : 4;
/* True if this scope is an SK_TEMPLATE_SPEC scope. This field is
only valid if KIND == SK_TEMPLATE_PARMS. */
BOOL_BITFIELD explicit_spec_p : 1;
/* true means make a BLOCK for this level regardless of all else. */
unsigned keep : 1;
/* Nonzero if this level can safely have additional
cleanup-needing variables added to it. */
unsigned more_cleanups_ok : 1;
unsigned have_cleanups : 1;
/* 24 bits left to fill a 32-bit word. */
};
/* A chain of _DECL nodes for all variables, constants, functions,
and typedef types. These are in the reverse of the order
supplied. There may be OVERLOADs on this list, too, but they
are wrapped in TREE_LISTs; the TREE_VALUE is the OVERLOAD. */
tree names;
/* A chain of NAMESPACE_DECL nodes. */
tree namespaces;
/* An array of static functions and variables (for namespaces only) */
VEC(tree,gc) *static_decls;
/* A list of USING_DECL nodes. */
tree usings;
/* A list of used namespaces. PURPOSE is the namespace,
VALUE the common ancestor with this binding_level's namespace. */
tree using_directives;
/* For the binding level corresponding to a class, the entities
declared in the class or its base classes. */
VEC(cp_class_binding,gc) *class_shadowed;
/* Similar to class_shadowed, but for IDENTIFIER_TYPE_VALUE, and
is used for all binding levels. The TREE_PURPOSE is the name of
the entity, the TREE_TYPE is the associated type. In addition
the TREE_VALUE is the IDENTIFIER_TYPE_VALUE before we entered
the class. */
tree type_shadowed;
/* Similar to class_shadowed, but for IDENTIFIER_LABEL_VALUE, and
used for all binding levels. */
VEC(cp_label_binding,gc) *shadowed_labels;
/* For each level (except not the global one),
a chain of BLOCK nodes for all the levels
that were entered and exited one level down. */
tree blocks;
/* The entity (namespace, class, function) the scope of which this
binding contour corresponds to. Otherwise NULL. */
tree this_entity;
/* The binding level which this one is contained in (inherits from). */
cp_binding_level *level_chain;
/* List of VAR_DECLS saved from a previous for statement.
These would be dead in ISO-conforming code, but might
be referenced in ARM-era code. */
VEC(tree,gc) *dead_vars_from_for;
/* STATEMENT_LIST for statements in this binding contour.
Only used at present for SK_CLEANUP temporary bindings. */
tree statement_list;
/* Binding depth at which this level began. */
int binding_depth;
/* The kind of scope that this object represents. However, a
SK_TEMPLATE_SPEC scope is represented with KIND set to
SK_TEMPLATE_PARMS and EXPLICIT_SPEC_P set to true. */
ENUM_BITFIELD (scope_kind) kind : 4;
/* True if this scope is an SK_TEMPLATE_SPEC scope. This field is
only valid if KIND == SK_TEMPLATE_PARMS. */
BOOL_BITFIELD explicit_spec_p : 1;
/* true means make a BLOCK for this level regardless of all else. */
unsigned keep : 1;
/* Nonzero if this level can safely have additional
cleanup-needing variables added to it. */
unsigned more_cleanups_ok : 1;
unsigned have_cleanups : 1;
/* 24 bits left to fill a 32-bit word. */
};
/* The binding level currently in effect. */
......@@ -287,14 +287,14 @@ extern GTY(()) tree global_type_node;
#define global_scope_p(SCOPE) \
((SCOPE) == NAMESPACE_LEVEL (global_namespace))
extern cxx_scope *leave_scope (void);
extern cp_binding_level *leave_scope (void);
extern bool kept_level_p (void);
extern bool global_bindings_p (void);
extern bool toplevel_bindings_p (void);
extern bool namespace_bindings_p (void);
extern bool template_parm_scope_p (void);
extern scope_kind innermost_scope_kind (void);
extern cxx_scope *begin_scope (scope_kind, tree);
extern cp_binding_level *begin_scope (scope_kind, tree);
extern void print_binding_stack (void);
extern void push_to_top_level (void);
extern void pop_from_top_level (void);
......@@ -305,7 +305,7 @@ extern tree push_scope (tree);
extern void pop_scope (tree);
extern tree push_inner_scope (tree);
extern void pop_inner_scope (tree, tree);
extern void push_binding_level (struct cp_binding_level *);
extern void push_binding_level (cp_binding_level *);
extern void push_namespace (tree);
extern void pop_namespace (void);
......@@ -314,7 +314,7 @@ extern void pop_nested_namespace (tree);
extern bool handle_namespace_attrs (tree, tree);
extern void pushlevel_class (void);
extern void poplevel_class (void);
extern tree pushdecl_with_scope (tree, cxx_scope *, bool);
extern tree pushdecl_with_scope (tree, cp_binding_level *, bool);
extern tree lookup_name_prefer_type (tree, int);
extern tree lookup_name_real (tree, int, int, bool, int, int);
extern tree lookup_type_scope (tree, tag_scope);
......
......@@ -1791,7 +1791,7 @@ determine_specialization (tree template_id,
with the signature of DECL. */
tree templates = NULL_TREE;
int header_count;
struct cp_binding_level *b;
cp_binding_level *b;
*targs_out = NULL_TREE;
......
......@@ -8452,7 +8452,7 @@ is_normal_capture_proxy (tree decl)
static inline void
insert_capture_proxy (tree var)
{
cxx_scope *b;
cp_binding_level *b;
int skip;
tree stmt_list;
......@@ -8461,7 +8461,7 @@ insert_capture_proxy (tree var)
b = current_binding_level;
for (skip = 0; ; ++skip)
{
cxx_scope *n = b->level_chain;
cp_binding_level *n = b->level_chain;
if (n->kind == sk_function_parms)
break;
b = n;
......
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