extern int check_static_variable_definition (tree, tree);
extern tree compute_array_index_type (tree, tree);
extern tree check_default_argument (tree, tree);
-extern int vtable_decl_p (tree, void *);
-extern int vtype_decl_p (tree, void *);
extern int sigtable_decl_p (tree, void *);
-typedef bool (*walk_globals_pred) (tree, void *);
-typedef bool (*walk_globals_fn) (tree *, void *);
-extern bool walk_globals (walk_globals_pred, walk_globals_fn, void *);
-extern bool walk_vtables (walk_globals_pred, walk_globals_fn, void *);
typedef int (*walk_namespaces_fn) (tree, void *);
extern int walk_namespaces (walk_namespaces_fn,
void *);
static const char *tag_name (enum tag_types);
static tree lookup_and_check_tag (enum tag_types, tree, tag_scope, bool);
static int walk_namespaces_r (tree, walk_namespaces_fn, void *);
-static int walk_globals_r (tree, void*);
-static int walk_vtables_r (tree, void*);
static tree make_label_decl (tree, int);
static void use_label (tree);
static void check_previous_goto_1 (tree, struct cp_binding_level *, tree,
= chainon (current_binding_level->blocks, block);
}
-/* Returns nonzero if T is a virtual function table. */
-
-int
-vtable_decl_p (tree t, void* data ATTRIBUTE_UNUSED )
-{
- return (TREE_CODE (t) == VAR_DECL && DECL_VIRTUAL_P (t));
-}
-
-/* Returns nonzero if T is a TYPE_DECL for a type with virtual
- functions. */
-
-int
-vtype_decl_p (tree t, void *data ATTRIBUTE_UNUSED )
-{
- return (TREE_CODE (t) == TYPE_DECL
- && TREE_CODE (TREE_TYPE (t)) == RECORD_TYPE
- && TYPE_POLYMORPHIC_P (TREE_TYPE (t)));
-}
-
-struct walk_globals_data {
- walk_globals_pred p;
- walk_globals_fn f;
- void *data;
-};
-
-/* Walk the vtable declarations in NAMESPACE. Whenever one is found
- for which P returns nonzero, call F with its address. If any call
- to F returns a nonzero value, return a nonzero value. */
-
-static int
-walk_vtables_r (tree namespace, void* data)
-{
- struct walk_globals_data* wgd = (struct walk_globals_data *) data;
- walk_globals_fn f = wgd->f;
- void *d = wgd->data;
- tree decl = NAMESPACE_LEVEL (namespace)->vtables;
- int result = 0;
-
- for (; decl ; decl = TREE_CHAIN (decl))
- result |= (*f) (&decl, d);
-
- return result;
-}
-
-/* Walk the vtable declarations. Whenever one is found for which P
- returns nonzero, call F with its address. If any call to F
- returns a nonzero value, return a nonzero value. */
-bool
-walk_vtables (walk_globals_pred p, walk_globals_fn f, void *data)
-{
- struct walk_globals_data wgd;
- wgd.p = p;
- wgd.f = f;
- wgd.data = data;
-
- return walk_namespaces (walk_vtables_r, &wgd);
-}
-
/* Walk all the namespaces contained NAMESPACE, including NAMESPACE
itself, calling F for each. The DATA is passed to F as well. */
return walk_namespaces_r (global_namespace, f, data);
}
-/* Walk the global declarations in NAMESPACE. Whenever one is found
- for which P returns nonzero, call F with its address. If any call
- to F returns a nonzero value, return a nonzero value. */
-
-static int
-walk_globals_r (tree namespace, void* data)
-{
- struct walk_globals_data* wgd = (struct walk_globals_data *) data;
- walk_globals_pred p = wgd->p;
- walk_globals_fn f = wgd->f;
- void *d = wgd->data;
- tree *t;
- int result = 0;
-
- t = &NAMESPACE_LEVEL (namespace)->names;
-
- while (*t)
- {
- tree glbl = *t;
-
- if ((*p) (glbl, d))
- result |= (*f) (t, d);
-
- /* If F changed *T, then *T still points at the next item to
- examine. */
- if (*t == glbl)
- t = &TREE_CHAIN (*t);
- }
-
- return result;
-}
-
-/* Walk the global declarations. Whenever one is found for which P
- returns true, call F with its address. If any call to F
- returns true, return true. */
-
-bool
-walk_globals (walk_globals_pred p, walk_globals_fn f, void *data)
-{
- struct walk_globals_data wgd;
- wgd.p = p;
- wgd.f = f;
- wgd.data = data;
-
- return walk_namespaces (walk_globals_r, &wgd);
-}
-
/* Call wrapup_globals_declarations for the globals in NAMESPACE. If
DATA is non-NULL, this is the last time we will call
wrapup_global_declarations for this NAMESPACE. */