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:
Tom Tromey 2018-11-24 09:20:18 -07:00
parent 592553c469
commit d8aeb77f04
6 changed files with 216 additions and 189 deletions

View file

@ -1395,23 +1395,28 @@ add_symbol_overload_list_qualified (const char *func_name,
/* Go through the symtabs and check the externs and statics for
symbols which match. */
struct objfile *objfile;
ALL_COMPUNITS (objfile, cust)
{
QUIT;
b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), GLOBAL_BLOCK);
add_symbol_overload_list_block (func_name, b, overload_list);
}
for (objfile *objfile : all_objfiles (current_program_space))
{
for (compunit_symtab *cust : objfile_compunits (objfile))
{
QUIT;
b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), GLOBAL_BLOCK);
add_symbol_overload_list_block (func_name, b, overload_list);
}
}
ALL_COMPUNITS (objfile, cust)
{
QUIT;
b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), STATIC_BLOCK);
/* Don't do this block twice. */
if (b == surrounding_static_block)
continue;
add_symbol_overload_list_block (func_name, b, overload_list);
}
for (objfile *objfile : all_objfiles (current_program_space))
{
for (compunit_symtab *cust : objfile_compunits (objfile))
{
QUIT;
b = BLOCKVECTOR_BLOCK (COMPUNIT_BLOCKVECTOR (cust), STATIC_BLOCK);
/* Don't do this block twice. */
if (b == surrounding_static_block)
continue;
add_symbol_overload_list_block (func_name, b, overload_list);
}
}
}
/* Lookup the rtti type for a class name. */