/* 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. */
/* 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. */
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;
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;
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)
{
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);
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)
}
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);
}
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)
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)
{
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);
struct cp_switch
{
- struct cp_binding_level *level;
+ cp_binding_level *level;
struct cp_switch *next;
/* The SWITCH_STMT being built. */
tree switch_stmt;
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)
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)
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;
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)));
};
#define EMPTY_SCOPE_BINDING { NULL_TREE, NULL_TREE }
-static cxx_scope *innermost_nonclass_level (void);
-static cxx_binding *binding_for_name (cxx_scope *, tree);
+static cp_binding_level *innermost_nonclass_level (void);
+static cxx_binding *binding_for_name (cp_binding_level *, tree);
static tree push_overloaded_decl (tree, int, bool);
static bool lookup_using_namespace (tree, struct scope_binding *, tree,
tree, int);
bindings) in the class scope indicated by SCOPE. */
static cxx_binding *
-new_class_binding (tree name, tree value, tree type, cxx_scope *scope)
+new_class_binding (tree name, tree value, tree type, cp_binding_level *scope)
{
cp_class_binding *cb;
cxx_binding *binding;
level at which this declaration is being bound. */
static void
-push_binding (tree id, tree decl, cxx_scope* level)
+push_binding (tree id, tree decl, cp_binding_level* level)
{
cxx_binding *binding;
/* Add DECL to the list of things declared in B. */
static void
-add_decl_to_level (tree decl, cxx_scope *b)
+add_decl_to_level (tree decl, cp_binding_level *b)
{
/* We used to record virtual tables as if they were ordinary
variables, but no longer do so. */
/* Here to install a non-global value. */
tree oldglobal = IDENTIFIER_NAMESPACE_VALUE (name);
tree oldlocal = NULL_TREE;
- cxx_scope *oldscope = NULL;
+ cp_binding_level *oldscope = NULL;
cxx_binding *oldbinding = outer_binding (name, NULL, true);
if (oldbinding)
{
{
/* Go to where the parms should be and see if we find
them there. */
- struct cp_binding_level *b = current_binding_level->level_chain;
+ cp_binding_level *b = current_binding_level->level_chain;
if (FUNCTION_NEEDS_BODY_BLOCK (current_function_decl))
/* Skip the ctor/dtor cleanup level. */
the containing function anyway. */
if (DECL_CONTEXT (oldlocal) != current_function_decl)
{
- cxx_scope *scope = current_binding_level;
+ cp_binding_level *scope = current_binding_level;
tree context = DECL_CONTEXT (oldlocal);
for (; scope; scope = scope->level_chain)
{
void
push_local_binding (tree id, tree decl, int flags)
{
- struct cp_binding_level *b;
+ cp_binding_level *b;
/* Skip over any local classes. This makes sense if we call
push_local_binding with a friend decl of a local class. */
/* Return a string describing the kind of SCOPE we have. */
static const char *
-cxx_scope_descriptor (cxx_scope *scope)
+cp_binding_level_descriptor (cp_binding_level *scope)
{
/* The order of this table must match the "scope_kind"
enumerators. */
/* Output a debugging information about SCOPE when performing
ACTION at LINE. */
static void
-cxx_scope_debug (cxx_scope *scope, int line, const char *action)
+cp_binding_level_debug (cp_binding_level *scope, int line, const char *action)
{
- const char *desc = cxx_scope_descriptor (scope);
+ const char *desc = cp_binding_level_descriptor (scope);
if (scope->this_entity)
verbatim ("%s %s(%E) %p %d\n", action, desc,
scope->this_entity, (void *) scope, line);
/* A chain of binding_level structures awaiting reuse. */
-static GTY((deletable)) struct cp_binding_level *free_binding_level;
+static GTY((deletable)) cp_binding_level *free_binding_level;
/* Insert SCOPE as the innermost binding level. */
void
-push_binding_level (struct cp_binding_level *scope)
+push_binding_level (cp_binding_level *scope)
{
/* Add it to the front of currently active scopes stack. */
scope->level_chain = current_binding_level;
{
scope->binding_depth = binding_depth;
indent (binding_depth);
- cxx_scope_debug (scope, input_line, "push");
+ cp_binding_level_debug (scope, input_line, "push");
binding_depth++;
}
}
ENTITY is the scope of the associated C++ entity (namespace, class,
function, C++0x enumeration); it is NULL otherwise. */
-cxx_scope *
+cp_binding_level *
begin_scope (scope_kind kind, tree entity)
{
- cxx_scope *scope;
+ cp_binding_level *scope;
/* Reuse or create a struct for this binding level. */
if (!ENABLE_SCOPE_CHECKING && free_binding_level)
{
scope = free_binding_level;
- memset (scope, 0, sizeof (cxx_scope));
+ memset (scope, 0, sizeof (cp_binding_level));
free_binding_level = scope->level_chain;
}
else
- scope = ggc_alloc_cleared_cxx_scope ();
+ scope = ggc_alloc_cleared_cp_binding_level ();
scope->this_entity = entity;
scope->more_cleanups_ok = true;
/* We're about to leave current scope. Pop the top of the stack of
currently active scopes. Return the enclosing scope, now active. */
-cxx_scope *
+cp_binding_level *
leave_scope (void)
{
- cxx_scope *scope = current_binding_level;
+ cp_binding_level *scope = current_binding_level;
if (scope->kind == sk_namespace && class_binding_level)
current_binding_level = class_binding_level;
if (ENABLE_SCOPE_CHECKING)
{
indent (--binding_depth);
- cxx_scope_debug (scope, input_line, "leave");
+ cp_binding_level_debug (scope, input_line, "leave");
}
/* Move one nesting level up. */
}
static void
-resume_scope (struct cp_binding_level* b)
+resume_scope (cp_binding_level* b)
{
/* Resuming binding levels is meant only for namespaces,
and those cannot nest into classes. */
{
b->binding_depth = binding_depth;
indent (binding_depth);
- cxx_scope_debug (b, input_line, "resume");
+ cp_binding_level_debug (b, input_line, "resume");
binding_depth++;
}
}
/* Return the innermost binding level that is not for a class scope. */
-static cxx_scope *
+static cp_binding_level *
innermost_nonclass_level (void)
{
- cxx_scope *b;
+ cp_binding_level *b;
b = current_binding_level;
while (b->kind == sk_class)
bool
toplevel_bindings_p (void)
{
- struct cp_binding_level *b = innermost_nonclass_level ();
+ cp_binding_level *b = innermost_nonclass_level ();
return b->kind == sk_namespace || b->kind == sk_template_parms;
}
bool
namespace_bindings_p (void)
{
- struct cp_binding_level *b = innermost_nonclass_level ();
+ cp_binding_level *b = innermost_nonclass_level ();
return b->kind == sk_namespace;
}
function_parm_depth (void)
{
int level = 0;
- struct cp_binding_level *b;
+ cp_binding_level *b;
for (b = current_binding_level;
b->kind == sk_function_parms;
static int no_print_builtins = 0;
static void
-print_binding_level (struct cp_binding_level* lvl)
+print_binding_level (cp_binding_level* lvl)
{
tree t;
int i = 0, len;
}
void
-print_other_binding_stack (struct cp_binding_level *stack)
+print_other_binding_stack (cp_binding_level *stack)
{
- struct cp_binding_level *level;
+ cp_binding_level *level;
for (level = stack; !global_scope_p (level); level = level->level_chain)
{
fprintf (stderr, "binding level %p\n", (void *) level);
void
print_binding_stack (void)
{
- struct cp_binding_level *b;
+ cp_binding_level *b;
fprintf (stderr, "current_binding_level=%p\n"
"class_binding_level=%p\n"
"NAMESPACE_LEVEL (global_namespace)=%p\n",
the tag ID is not already defined. */
static void
-set_identifier_type_value_with_scope (tree id, tree decl, cxx_scope *b)
+set_identifier_type_value_with_scope (tree id, tree decl, cp_binding_level *b)
{
tree type;
/* Return (from the stack of) the BINDING, if any, established at SCOPE. */
static inline cxx_binding *
-find_binding (cxx_scope *scope, cxx_binding *binding)
+find_binding (cp_binding_level *scope, cxx_binding *binding)
{
for (; binding != NULL; binding = binding->previous)
if (binding->scope == scope)
/* Return the binding for NAME in SCOPE, if any. Otherwise, return NULL. */
static inline cxx_binding *
-cxx_scope_find_binding_for_name (cxx_scope *scope, tree name)
+cp_binding_level_find_binding_for_name (cp_binding_level *scope, tree name)
{
cxx_binding *b = IDENTIFIER_NAMESPACE_BINDINGS (name);
if (b)
found, make a new one. */
static cxx_binding *
-binding_for_name (cxx_scope *scope, tree name)
+binding_for_name (cp_binding_level *scope, tree name)
{
cxx_binding *result;
- result = cxx_scope_find_binding_for_name (scope, name);
+ result = cp_binding_level_find_binding_for_name (scope, name);
if (result)
return result;
/* Not found, make a new one. */
closer binding level than LEVEL. */
static tree
-pushdecl_with_scope_1 (tree x, cxx_scope *level, bool is_friend)
+pushdecl_with_scope_1 (tree x, cp_binding_level *level, bool is_friend)
{
- struct cp_binding_level *b;
+ cp_binding_level *b;
tree function_decl = current_function_decl;
current_function_decl = NULL_TREE;
/* Wrapper for pushdecl_with_scope_1. */
tree
-pushdecl_with_scope (tree x, cxx_scope *level, bool is_friend)
+pushdecl_with_scope (tree x, cp_binding_level *level, bool is_friend)
{
tree ret;
bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
push_inner_scope_r (outer, prev);
if (TREE_CODE (inner) == NAMESPACE_DECL)
{
- struct cp_binding_level *save_template_parm = 0;
+ cp_binding_level *save_template_parm = 0;
/* Temporary take out template parameter scopes. They are saved
in reversed order in save_template_parm. */
while (current_binding_level->kind == sk_template_parms)
{
- struct cp_binding_level *b = current_binding_level;
+ cp_binding_level *b = current_binding_level;
current_binding_level = b->level_chain;
b->level_chain = save_template_parm;
save_template_parm = b;
/* Restore template parameter scopes. */
while (save_template_parm)
{
- struct cp_binding_level *b = save_template_parm;
+ cp_binding_level *b = save_template_parm;
save_template_parm = b->level_chain;
b->level_chain = current_binding_level;
current_binding_level = b;
{
if (TREE_CODE (inner) == NAMESPACE_DECL)
{
- struct cp_binding_level *save_template_parm = 0;
+ cp_binding_level *save_template_parm = 0;
/* Temporary take out template parameter scopes. They are saved
in reversed order in save_template_parm. */
while (current_binding_level->kind == sk_template_parms)
{
- struct cp_binding_level *b = current_binding_level;
+ cp_binding_level *b = current_binding_level;
current_binding_level = b->level_chain;
b->level_chain = save_template_parm;
save_template_parm = b;
/* Restore template parameter scopes. */
while (save_template_parm)
{
- struct cp_binding_level *b = save_template_parm;
+ cp_binding_level *b = save_template_parm;
save_template_parm = b->level_chain;
b->level_chain = current_binding_level;
current_binding_level = b;
void
poplevel_class (void)
{
- struct cp_binding_level *level = class_binding_level;
+ cp_binding_level *level = class_binding_level;
cp_class_binding *cb;
size_t i;
tree shadowed;
is not set, callers must set the PREVIOUS field explicitly. */
static cxx_binding *
-get_class_binding (tree name, cxx_scope *scope)
+get_class_binding (tree name, cp_binding_level *scope)
{
tree class_type;
tree type_binding;
/* Unnecessary for the global namespace because it can't be an alias. */
scope = ORIGINAL_NAMESPACE (scope);
- binding = cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
+ binding = cp_binding_level_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
return binding ? binding->value : NULL_TREE;
}
tree
pushdecl_namespace_level (tree x, bool is_friend)
{
- struct cp_binding_level *b = current_binding_level;
+ cp_binding_level *b = current_binding_level;
tree t;
bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
{
tree scope = VEC_pop (tree, namespaces_to_search);
struct scope_binding binding = EMPTY_SCOPE_BINDING;
- struct cp_binding_level *level = NAMESPACE_LEVEL (scope);
+ cp_binding_level *level = NAMESPACE_LEVEL (scope);
/* Look in this namespace. */
qualified_lookup_using_namespace (name, scope, &binding, 0);
tree initial = current_decl_namespace ();
tree scope = initial;
tree siter;
- struct cp_binding_level *level;
+ cp_binding_level *level;
tree val = NULL_TREE;
for (; !val; scope = CP_DECL_CONTEXT (scope))
{
struct scope_binding binding = EMPTY_SCOPE_BINDING;
cxx_binding *b =
- cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
+ cp_binding_level_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
if (b)
ambiguous_decl (&binding, b, flags);
{
tree used = ORIGINAL_NAMESPACE (TREE_PURPOSE (iter));
cxx_binding *val1 =
- cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (used), name);
+ cp_binding_level_find_binding_for_name (NAMESPACE_LEVEL (used), name);
/* Resolve ambiguities. */
if (val1)
ambiguous_decl (val, val1, flags);
VEC_safe_push (tree, gc, seen_inline, scope);
binding =
- cxx_scope_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
+ cp_binding_level_find_binding_for_name (NAMESPACE_LEVEL (scope), name);
if (binding)
{
found_here = true;
static bool
binding_to_template_parms_of_scope_p (cxx_binding *binding,
- cxx_scope *scope)
+ cp_binding_level *scope)
{
tree binding_value;
bool class_p)
{
cxx_binding *outer;
- cxx_scope *scope;
- cxx_scope *outer_scope;
+ cp_binding_level *scope;
+ cp_binding_level *outer_scope;
if (binding)
{
operators. */
if (IDENTIFIER_TYPENAME_P (name))
{
- struct cp_binding_level *level;
+ cp_binding_level *level;
for (level = current_binding_level;
level && level->kind != sk_namespace;
/* Look in namespace scope. */
if (!val)
{
- iter = cxx_scope_find_binding_for_name
+ iter = cp_binding_level_find_binding_for_name
(NAMESPACE_LEVEL (current_decl_namespace ()), name);
if (iter)
and template parameter scopes. */
if (val)
{
- struct cp_binding_level *b = current_binding_level;
+ cp_binding_level *b = current_binding_level;
while (b)
{
if (iter->scope == b)
static tree
lookup_name_innermost_nonclass_level_1 (tree name)
{
- struct cp_binding_level *b;
+ cp_binding_level *b;
tree t = NULL_TREE;
b = innermost_nonclass_level ();
if (REAL_IDENTIFIER_TYPE_VALUE (name) != NULL_TREE
&& REAL_IDENTIFIER_TYPE_VALUE (name) != global_type_node)
{
- struct cp_binding_level *b = current_binding_level;
+ cp_binding_level *b = current_binding_level;
while (1)
{
if (purpose_member (name, b->type_shadowed))
static tree
maybe_process_template_type_declaration (tree type, int is_friend,
- cxx_scope *b)
+ cp_binding_level *b)
{
tree decl = TYPE_NAME (type);
static tree
pushtag_1 (tree name, tree type, tag_scope scope)
{
- struct cp_binding_level *b;
+ cp_binding_level *b;
tree decl;
b = current_binding_level;
push_to_top_level (void)
{
struct saved_scope *s;
- struct cp_binding_level *b;
+ cp_binding_level *b;
cxx_saved_binding *sb;
size_t i;
bool need_pop;
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. */
/* 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;
};
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. */
#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);
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 *);
\f
extern void push_namespace (tree);
extern void pop_namespace (void);
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);