aboutsummaryrefslogtreecommitdiff
path: root/gdb/maint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-11-24 09:20:18 -0700
committerTom Tromey <tom@tromey.com>2019-01-09 18:28:15 -0700
commitd8aeb77f040ced7d37ab83f032b2e4ded2c81ca5 (patch)
tree18324cc1d77dd8bb6cea91bfecd703746b9c71f3 /gdb/maint.c
parent592553c46959c98bf5981ad245d0fbb97f373d2a (diff)
downloadbinutils-d8aeb77f040ced7d37ab83f032b2e4ded2c81ca5.zip
binutils-d8aeb77f040ced7d37ab83f032b2e4ded2c81ca5.tar.gz
binutils-d8aeb77f040ced7d37ab83f032b2e4ded2c81ca5.tar.bz2
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.
Diffstat (limited to 'gdb/maint.c')
-rw-r--r--gdb/maint.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gdb/maint.c b/gdb/maint.c
index a4241cd..d969e79 100644
--- a/gdb/maint.c
+++ b/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;
+ }
}
}