Break out decl.c (2/n)
Break out decl.c (2/n) * name-lookup.c: Include diagnostic.h (cxx_binding_free): Make static. (cxx_binding_make): Likewise. (binding_table_new): Likewise (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. (supplement_binding): Likewise. * name-lookup.h (global_scope_name): Declare extern. (global_type_node): Likewise. (cxx_binding_free): Don't export. (cxx_binding_make): Likewise. (binding_table_new): Likewise. (binding_table_free): Likewise. (binding_table_insert): Likewise. (binding_table_find_anon_type): Likewise. (binding_table_reverse_maybe_remap): Likewise. * Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H) * decl.c (lookup_namespace_name): Move to name-lookup.c (select_decl): Likewise. (unqualified_namespace_lookup): Likewise. (lookup_qualified_name): Likewise. (lookup_name_real): Likewise. (lookup_name_nonclass): Likewise. (lookup_function_nonclass): Likewise. (lookup_name): Likewise. (lookup_name_current_level): Likewise. (lookup_type_current_level): Likewise. (lookup_flags): Likewise. (qualify_lookup): Likewise. (lookup_tag): Likewise. (lookup_tag_reverse): Likewise. (getdecls): Likewise. (storedecls): Remove. (cxx_remember_type_decls): Likewise. (global_bindings_p): Likewise. (innermost_nonclass_level): Likewise. (toplevel_bindings_p): Likewise. (namespace_bindings_p): Likewise. (kept_level_p): Likewise. (innermost_scope_kind): Likewise. (template_parm_scope_p): Likewise. (push_binding): Likewise. (push_local_binding): Likewise. (add_decl_to_level): Likewise. Make extern. (push_class_binding): Move to name-lookup.c. (resume_level): Likewise. Rename to resume_scope. (begin_scope): Likewise. (indent): Likewise. (binding_depth): Likewise. (is_class_level): Likewise. (cxx_scope_descriptor): Likewise. (cxx_scope_debug): Likewise. (namespace_scope_ht_size): Likewise. (leave_scope): Likewise. (pushlevel_class): Likewise. (poplevel_class): Likewise. (clear_identifier_class_values): Likewise. (pushdecl_with_scope): Likewise. (pushdecl_namespace_level): Likewise. (pushdecl_class_level): Likewise. (push_class_level_binding): Likewise. (push_using_directive): Likewise. (identifier_global_value): Likewise. (keep_next_level_flag): Likewise. (keep_next_level): Likewise. (free_binding_level): Likewise. (set_class_shadows): Likewise. (maybe_push_cleanup_level): Likewise. (cp_namespace_decls): Likewise. (bt_print_entry): Likewise. (print_binding_level): Likewise. (print_other_binding_stack): Likewise. (print_binding_stack): Likewise. (push_namespace): Likewise. (pop_namespace): Likewise. (push_nested_namespace): Likewise. (pop_nested_namespace): Likewise. (cxx_saved_binding_make): Likewise. (struct cxx_saved_binding_make): Likewise. (store_bindings): Likewise. (maybe_push_to_top_level): Likewise. (push_to_top_level): Likewise. (pop_from_top_level): Likewise. (identifier_type_value): Likewise. (set_identifier_type_value): Likewise. (set_identifier_type_value_with_scope): Likewise. (pop_everything): Likewise. (pushtag): Likewise. (follow_tag_typedef): Likewise. (maybe_process_template_type_declaration): Likewise. (pop_binding): Likewise. * cp-tree.h: Move corresponding declarations to name-lookup.h From-SVN: r72426
This commit is contained in:
parent
4f0504d907
commit
00e8de680e
6 changed files with 2394 additions and 2331 deletions
|
@ -1,3 +1,101 @@
|
|||
2003-10-13 Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
Break out decl.c (2/n)
|
||||
* name-lookup.c: Include diagnostic.h
|
||||
(cxx_binding_free): Make static.
|
||||
(cxx_binding_make): Likewise.
|
||||
(binding_table_new): Likewise
|
||||
(binding_table_free): Likewise.
|
||||
(binding_table_insert): Likewise.
|
||||
(binding_table_find_anon_type): Likewise.
|
||||
(binding_table_reverse_maybe_remap): Likewise.
|
||||
(supplement_binding): Likewise.
|
||||
* name-lookup.h (global_scope_name): Declare extern.
|
||||
(global_type_node): Likewise.
|
||||
(cxx_binding_free): Don't export.
|
||||
(cxx_binding_make): Likewise.
|
||||
(binding_table_new): Likewise.
|
||||
(binding_table_free): Likewise.
|
||||
(binding_table_insert): Likewise.
|
||||
(binding_table_find_anon_type): Likewise.
|
||||
(binding_table_reverse_maybe_remap): Likewise.
|
||||
* Make-lang.in (cp/name-lookup.o): Depend on $(DIAGNOSTIC_H)
|
||||
* decl.c (lookup_namespace_name): Move to name-lookup.c
|
||||
(select_decl): Likewise.
|
||||
(unqualified_namespace_lookup): Likewise.
|
||||
(lookup_qualified_name): Likewise.
|
||||
(lookup_name_real): Likewise.
|
||||
(lookup_name_nonclass): Likewise.
|
||||
(lookup_function_nonclass): Likewise.
|
||||
(lookup_name): Likewise.
|
||||
(lookup_name_current_level): Likewise.
|
||||
(lookup_type_current_level): Likewise.
|
||||
(lookup_flags): Likewise.
|
||||
(qualify_lookup): Likewise.
|
||||
(lookup_tag): Likewise.
|
||||
(lookup_tag_reverse): Likewise.
|
||||
(getdecls): Likewise.
|
||||
(storedecls): Remove.
|
||||
(cxx_remember_type_decls): Likewise.
|
||||
(global_bindings_p): Likewise.
|
||||
(innermost_nonclass_level): Likewise.
|
||||
(toplevel_bindings_p): Likewise.
|
||||
(namespace_bindings_p): Likewise.
|
||||
(kept_level_p): Likewise.
|
||||
(innermost_scope_kind): Likewise.
|
||||
(template_parm_scope_p): Likewise.
|
||||
(push_binding): Likewise.
|
||||
(push_local_binding): Likewise.
|
||||
(add_decl_to_level): Likewise. Make extern.
|
||||
(push_class_binding): Move to name-lookup.c.
|
||||
(resume_level): Likewise. Rename to resume_scope.
|
||||
(begin_scope): Likewise.
|
||||
(indent): Likewise.
|
||||
(binding_depth): Likewise.
|
||||
(is_class_level): Likewise.
|
||||
(cxx_scope_descriptor): Likewise.
|
||||
(cxx_scope_debug): Likewise.
|
||||
(namespace_scope_ht_size): Likewise.
|
||||
(leave_scope): Likewise.
|
||||
(pushlevel_class): Likewise.
|
||||
(poplevel_class): Likewise.
|
||||
(clear_identifier_class_values): Likewise.
|
||||
(pushdecl_with_scope): Likewise.
|
||||
(pushdecl_namespace_level): Likewise.
|
||||
(pushdecl_class_level): Likewise.
|
||||
(push_class_level_binding): Likewise.
|
||||
(push_using_directive): Likewise.
|
||||
(identifier_global_value): Likewise.
|
||||
(keep_next_level_flag): Likewise.
|
||||
(keep_next_level): Likewise.
|
||||
(free_binding_level): Likewise.
|
||||
(set_class_shadows): Likewise.
|
||||
(maybe_push_cleanup_level): Likewise.
|
||||
(cp_namespace_decls): Likewise.
|
||||
(bt_print_entry): Likewise.
|
||||
(print_binding_level): Likewise.
|
||||
(print_other_binding_stack): Likewise.
|
||||
(print_binding_stack): Likewise.
|
||||
(push_namespace): Likewise.
|
||||
(pop_namespace): Likewise.
|
||||
(push_nested_namespace): Likewise.
|
||||
(pop_nested_namespace): Likewise.
|
||||
(cxx_saved_binding_make): Likewise.
|
||||
(struct cxx_saved_binding_make): Likewise.
|
||||
(store_bindings): Likewise.
|
||||
(maybe_push_to_top_level): Likewise.
|
||||
(push_to_top_level): Likewise.
|
||||
(pop_from_top_level): Likewise.
|
||||
(identifier_type_value): Likewise.
|
||||
(set_identifier_type_value): Likewise.
|
||||
(set_identifier_type_value_with_scope): Likewise.
|
||||
(pop_everything): Likewise.
|
||||
(pushtag): Likewise.
|
||||
(follow_tag_typedef): Likewise.
|
||||
(maybe_process_template_type_declaration): Likewise.
|
||||
(pop_binding): Likewise.
|
||||
* cp-tree.h: Move corresponding declarations to name-lookup.h
|
||||
|
||||
2003-10-12 Steven Bosscher <steven@gcc.gnu.org>
|
||||
|
||||
* cvt.c (ocp_convert): Move warning to C common code.
|
||||
|
|
|
@ -279,7 +279,8 @@ cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h real.h gt-cp-mangle.h $(
|
|||
cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) diagnostic.h gt-cp-parser.h output.h
|
||||
|
||||
cp/name-lookup.o: cp/name-lookup.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
|
||||
$(TM_H) $(CXX_TREE_H) timevar.h gt-cp-name-lookup.h toplev.h
|
||||
$(TM_H) $(CXX_TREE_H) timevar.h gt-cp-name-lookup.h toplev.h \
|
||||
$(DIAGNOSTIC_H)
|
||||
|
||||
cp/cxx-pretty-print.o: cp/cxx-pretty-print.c $(CXX_PRETTY_PRINT_H) \
|
||||
$(CONFIG_H) $(SYSTEM_H) $(TM_H) coretypes.h $(CXX_TREE_H)
|
||||
|
|
|
@ -3584,9 +3584,6 @@ extern void clone_function_decl (tree, int);
|
|||
extern void adjust_clone_args (tree);
|
||||
|
||||
/* decl.c */
|
||||
extern int global_bindings_p (void);
|
||||
extern int kept_level_p (void);
|
||||
extern tree getdecls (void);
|
||||
extern void insert_block (tree);
|
||||
extern void set_block (tree);
|
||||
extern tree pushdecl (tree);
|
||||
|
@ -3597,34 +3594,12 @@ extern bool cxx_mark_addressable (tree);
|
|||
extern void cxx_push_function_context (struct function *);
|
||||
extern void cxx_pop_function_context (struct function *);
|
||||
extern void cxx_mark_function_context (struct function *);
|
||||
extern int toplevel_bindings_p (void);
|
||||
extern int namespace_bindings_p (void);
|
||||
extern void keep_next_level (bool);
|
||||
extern scope_kind innermost_scope_kind (void);
|
||||
extern int template_parm_scope_p (void);
|
||||
extern void set_class_shadows (tree);
|
||||
extern void maybe_push_cleanup_level (tree);
|
||||
extern cxx_scope *begin_scope (scope_kind, tree);
|
||||
extern void maybe_push_cleanup_level (tree);
|
||||
extern void finish_scope (void);
|
||||
extern void resume_level (struct cp_binding_level *);
|
||||
extern void delete_block (tree);
|
||||
extern void add_block_current_level (tree);
|
||||
extern void pushlevel_class (void);
|
||||
extern void poplevel_class (void);
|
||||
extern void print_binding_stack (void);
|
||||
extern void print_binding_level (struct cp_binding_level *);
|
||||
extern void push_namespace (tree);
|
||||
extern void pop_namespace (void);
|
||||
extern void push_nested_namespace (tree);
|
||||
extern void pop_nested_namespace (tree);
|
||||
extern void maybe_push_to_top_level (int);
|
||||
extern void push_to_top_level (void);
|
||||
extern void pop_from_top_level (void);
|
||||
extern void push_switch (tree);
|
||||
extern void pop_switch (void);
|
||||
extern tree identifier_type_value (tree);
|
||||
extern void set_identifier_type_value (tree, tree);
|
||||
extern void pop_everything (void);
|
||||
extern void pushtag (tree, tree, int);
|
||||
extern tree make_anon_name (void);
|
||||
extern void clear_anon_tags (void);
|
||||
|
@ -3632,31 +3607,16 @@ extern int decls_match (tree, tree);
|
|||
extern int duplicate_decls (tree, tree);
|
||||
extern tree pushdecl_top_level (tree);
|
||||
extern tree pushdecl_top_level_and_finish (tree, tree);
|
||||
extern bool pushdecl_class_level (tree);
|
||||
extern tree pushdecl_namespace_level (tree);
|
||||
extern tree push_using_decl (tree, tree);
|
||||
extern tree push_using_directive (tree);
|
||||
extern bool push_class_level_binding (tree, tree);
|
||||
extern tree implicitly_declare (tree);
|
||||
extern tree declare_local_label (tree);
|
||||
extern tree define_label (location_t, tree);
|
||||
extern void check_goto (tree);
|
||||
extern void define_case_label (void);
|
||||
extern tree namespace_binding (tree, tree);
|
||||
extern void set_namespace_binding (tree, tree, tree);
|
||||
extern tree lookup_namespace_name (tree, tree);
|
||||
extern tree make_typename_type (tree, tree, tsubst_flags_t);
|
||||
extern tree make_unbound_class_template (tree, tree, tsubst_flags_t);
|
||||
extern tree lookup_name_nonclass (tree);
|
||||
extern tree lookup_function_nonclass (tree, tree);
|
||||
extern tree lookup_qualified_name (tree, tree, bool, bool);
|
||||
extern tree lookup_name (tree, int);
|
||||
extern tree lookup_name_current_level (tree);
|
||||
extern tree lookup_type_current_level (tree);
|
||||
extern tree lookup_name_real (tree, int, int, int, int);
|
||||
extern tree namespace_ancestor (tree, tree);
|
||||
extern bool is_ancestor (tree, tree);
|
||||
extern tree unqualified_namespace_lookup (tree, int, tree *);
|
||||
extern tree check_for_out_of_scope_variable (tree);
|
||||
extern bool lookup_using_namespace (tree, cxx_binding *, tree, tree, int, tree *);
|
||||
extern bool qualified_lookup_using_namespace (tree, tree, cxx_binding *, int);
|
||||
|
@ -3705,12 +3665,8 @@ extern void revert_static_member_fn (tree);
|
|||
extern void fixup_anonymous_aggr (tree);
|
||||
extern int check_static_variable_definition (tree, tree);
|
||||
extern tree compute_array_index_type (tree, tree);
|
||||
extern void push_local_binding (tree, tree, int);
|
||||
extern int push_class_binding (tree, tree);
|
||||
extern tree check_default_argument (tree, tree);
|
||||
extern tree push_overloaded_decl (tree, int);
|
||||
extern void clear_identifier_class_values (void);
|
||||
extern void storetags (tree);
|
||||
extern int vtable_decl_p (tree, void *);
|
||||
extern int vtype_decl_p (tree, void *);
|
||||
extern int sigtable_decl_p (tree, void *);
|
||||
|
@ -3722,7 +3678,6 @@ typedef int (*walk_namespaces_fn) (tree, void *);
|
|||
extern int walk_namespaces (walk_namespaces_fn,
|
||||
void *);
|
||||
extern int wrapup_globals_for_namespace (tree, void *);
|
||||
extern tree cp_namespace_decls (tree);
|
||||
extern tree create_implicit_typedef (tree, tree);
|
||||
extern tree maybe_push_decl (tree);
|
||||
extern tree build_target_expr_with_type (tree, tree);
|
||||
|
@ -3736,6 +3691,7 @@ extern tree check_elaborated_type_specifier (enum tag_types, tree, bool);
|
|||
extern tree cxx_builtin_type_decls (void);
|
||||
|
||||
extern bool have_extern_spec;
|
||||
extern GTY(()) tree last_function_parms;
|
||||
|
||||
/* in decl2.c */
|
||||
extern bool check_java_method (tree);
|
||||
|
|
2268
gcc/cp/decl.c
2268
gcc/cp/decl.c
File diff suppressed because it is too large
Load diff
2243
gcc/cp/name-lookup.c
2243
gcc/cp/name-lookup.c
File diff suppressed because it is too large
Load diff
|
@ -46,12 +46,6 @@ struct binding_entry_s GTY(())
|
|||
#define NAMESPACE_STD_HT_SIZE (1 << 8)
|
||||
#define GLOBAL_SCOPE_HT_SIZE (1 << 8)
|
||||
|
||||
extern binding_table binding_table_new (size_t);
|
||||
extern void binding_table_free (binding_table);
|
||||
extern void binding_table_insert (binding_table, tree, tree);
|
||||
extern tree binding_table_find_anon_type (binding_table, tree);
|
||||
extern binding_entry binding_table_reverse_maybe_remap (binding_table,
|
||||
tree, tree);
|
||||
extern void binding_table_remove_anonymous_types (binding_table);
|
||||
extern void binding_table_foreach (binding_table, bt_foreach_proc, void *);
|
||||
extern binding_entry binding_table_find (binding_table, tree);
|
||||
|
@ -93,9 +87,10 @@ struct cxx_binding GTY(())
|
|||
unsigned is_local : 1;
|
||||
};
|
||||
|
||||
extern cxx_binding *cxx_binding_make (tree, tree);
|
||||
extern void cxx_binding_free (cxx_binding *);
|
||||
extern bool supplement_binding (cxx_binding *, tree);
|
||||
extern tree identifier_type_value (tree);
|
||||
extern void set_identifier_type_value (tree, tree);
|
||||
extern void pop_binding (tree, tree);
|
||||
extern void clear_identifier_class_values (void);
|
||||
|
||||
/* The kinds of scopes we recognize. */
|
||||
typedef enum scope_kind {
|
||||
|
@ -246,16 +241,66 @@ struct cp_binding_level GTY(())
|
|||
|
||||
/* The tree node representing the global scope. */
|
||||
extern GTY(()) tree global_namespace;
|
||||
extern GTY(()) tree global_scope_name;
|
||||
|
||||
/* Indicates that there is a type value in some namespace, although
|
||||
that is not necessarily in scope at the moment. */
|
||||
|
||||
extern GTY(()) tree global_type_node;
|
||||
|
||||
/* True if SCOPE designates the global scope binding contour. */
|
||||
#define global_scope_p(SCOPE) \
|
||||
((SCOPE) == NAMESPACE_LEVEL (global_namespace))
|
||||
|
||||
extern cxx_scope *leave_scope (void);
|
||||
extern bool kept_level_p (void);
|
||||
extern int 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 void print_binding_stack (void);
|
||||
extern void print_binding_level (cxx_scope *);
|
||||
extern void push_to_top_level (void);
|
||||
extern void pop_from_top_level (void);
|
||||
extern void maybe_push_to_top_level (int);
|
||||
extern void pop_everything (void);
|
||||
extern void keep_next_level (bool);
|
||||
|
||||
extern void push_namespace (tree);
|
||||
extern void pop_namespace (void);
|
||||
extern void push_nested_namespace (tree);
|
||||
extern void pop_nested_namespace (tree);
|
||||
extern tree push_using_directive (tree);
|
||||
extern void pushlevel_class (void);
|
||||
extern void poplevel_class (void);
|
||||
extern cxx_binding *cxx_scope_find_binding_for_name (cxx_scope *, tree);
|
||||
extern cxx_binding *binding_for_name (cxx_scope *, tree);
|
||||
|
||||
extern tree pushdecl_with_scope (tree, cxx_scope *);
|
||||
extern tree lookup_tag (enum tree_code, tree, cxx_scope *, int);
|
||||
extern tree lookup_tag_reverse (tree, tree);
|
||||
extern tree lookup_name (tree, int);
|
||||
extern tree lookup_name_real (tree, int, int, int, int);
|
||||
extern tree lookup_name_current_level (tree);
|
||||
extern tree lookup_type_current_level (tree);
|
||||
extern tree namespace_binding (tree, tree);
|
||||
extern void add_decl_to_level (tree, cxx_scope *);
|
||||
extern void set_namespace_binding (tree, tree, tree);
|
||||
extern tree lookup_namespace_name (tree, tree);
|
||||
extern tree unqualified_namespace_lookup (tree, int, tree *);
|
||||
extern tree lookup_qualified_name (tree, tree, bool, bool);
|
||||
extern tree lookup_name_nonclass (tree);
|
||||
extern tree lookup_function_nonclass (tree, tree);
|
||||
extern void push_local_binding (tree, tree, int);
|
||||
extern int push_class_binding (tree, tree);
|
||||
extern bool pushdecl_class_level (tree);
|
||||
extern tree pushdecl_namespace_level (tree);
|
||||
extern bool push_class_level_binding (tree, tree);
|
||||
extern void storetags (tree);
|
||||
extern tree getdecls (void);
|
||||
extern tree cp_namespace_decls (tree);
|
||||
extern void set_class_shadows (tree);
|
||||
|
||||
|
||||
/* Set *DECL to the (non-hidden) declaration for ID at global scope,
|
||||
|
|
Loading…
Add table
Reference in a new issue