forked from Imagelibrary/binutils-gdb
Remove ALL_COMPUNITS
This removes the ALL_COMPUNITS, replacing its uses with two nested ranged for loops. gdb/ChangeLog 2019-01-09 Tom Tromey <tom@tromey.com> * symtab.c (lookup_objfile_from_block) (find_pc_sect_compunit_symtab, search_symbols) (default_collect_symbol_completion_matches_break_on): Use objfile_compunits. * objfiles.h (ALL_COMPUNITS): Remove. * maint.c (count_symtabs_and_blocks): Use objfile_compunits. * cp-support.c (add_symbol_overload_list_qualified): Use objfile_compunits. * ada-lang.c (ada_collect_symbol_completion_matches) (ada_add_global_exceptions): Use objfile_compunits.
This commit is contained in:
14
gdb/maint.c
14
gdb/maint.c
@@ -762,7 +762,6 @@ static void
|
||||
count_symtabs_and_blocks (int *nr_symtabs_ptr, int *nr_compunit_symtabs_ptr,
|
||||
int *nr_blocks_ptr)
|
||||
{
|
||||
struct objfile *o;
|
||||
struct symtab *s;
|
||||
int nr_symtabs = 0;
|
||||
int nr_compunit_symtabs = 0;
|
||||
@@ -773,12 +772,15 @@ count_symtabs_and_blocks (int *nr_symtabs_ptr, int *nr_compunit_symtabs_ptr,
|
||||
current_program_space may be NULL. */
|
||||
if (current_program_space != NULL)
|
||||
{
|
||||
ALL_COMPUNITS (o, cu)
|
||||
for (objfile *o : all_objfiles (current_program_space))
|
||||
{
|
||||
++nr_compunit_symtabs;
|
||||
nr_blocks += BLOCKVECTOR_NBLOCKS (COMPUNIT_BLOCKVECTOR (cu));
|
||||
ALL_COMPUNIT_FILETABS (cu, s)
|
||||
++nr_symtabs;
|
||||
for (compunit_symtab *cu : objfile_compunits (o))
|
||||
{
|
||||
++nr_compunit_symtabs;
|
||||
nr_blocks += BLOCKVECTOR_NBLOCKS (COMPUNIT_BLOCKVECTOR (cu));
|
||||
ALL_COMPUNIT_FILETABS (cu, s)
|
||||
++nr_symtabs;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user