Add compunits range adapter to objfile
This removes the objfile_compunits range adapter in favor of using a method on objfile. 2019-01-15 Tom Tromey <tom@tromey.com> * symtab.c (lookup_objfile_from_block) (lookup_symbol_in_objfile_symtabs) (basic_lookup_transparent_type_1, find_pc_sect_compunit_symtab) (find_line_symtab, info_sources_command) (default_collect_symbol_completion_matches_break_on) (make_source_files_completion_list): Update. * symmisc.c (print_objfile_statistics, dump_objfile) (maintenance_print_symbols, maintenance_info_symtabs) (maintenance_check_symtabs, maintenance_info_line_tables): Update. * source.c (select_source_symtab) (forget_cached_source_info_for_objfile): Update. * objfiles.h (class objfile_compunits): Remove. (struct objfile) <compunits_range>: New typedef. (compunits): New method. * objfiles.c (objfile_relocate1): Update. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Update. * maint.c (count_symtabs_and_blocks): Update. * linespec.c (iterate_over_all_matching_symtabs): Update. * cp-support.c (add_symbol_overload_list_qualified): Update. * coffread.c (coff_symtab_read): Update. * ada-lang.c (add_nonlocal_symbols) (ada_collect_symbol_completion_matches) (ada_add_global_exceptions): Update.
This commit is contained in:
parent
7e955d83c4
commit
b669c95337
12 changed files with 67 additions and 44 deletions
|
@ -301,6 +301,15 @@ struct objfile
|
|||
partial_symtabs.reset (new psymtab_storage ());
|
||||
}
|
||||
|
||||
typedef next_adapter<struct compunit_symtab> compunits_range;
|
||||
|
||||
/* A range adapter that makes it possible to iterate over all
|
||||
compunits in one objfile. */
|
||||
|
||||
compunits_range compunits ()
|
||||
{
|
||||
return compunits_range (compunit_symtabs);
|
||||
}
|
||||
|
||||
/* All struct objfile's are chained together by their next pointers.
|
||||
The program space field "objfiles" (frequently referenced via
|
||||
|
@ -553,19 +562,6 @@ extern void default_iterate_over_objfiles_in_search_order
|
|||
void *cb_data, struct objfile *current_objfile);
|
||||
|
||||
|
||||
/* A range adapter that makes it possible to iterate over all
|
||||
compunits in one objfile. */
|
||||
|
||||
class objfile_compunits : public next_adapter<struct compunit_symtab>
|
||||
{
|
||||
public:
|
||||
|
||||
explicit objfile_compunits (struct objfile *objfile)
|
||||
: next_adapter<struct compunit_symtab> (objfile->compunit_symtabs)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
/* A range adapter that makes it possible to iterate over all
|
||||
minimal symbols of an objfile. */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue