aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-11-24 09:49:24 -0700
committerTom Tromey <tom@tromey.com>2019-01-09 18:28:15 -0700
commit5accd1a07e080c386918da413e0f9e90c4cab58a (patch)
treee57e6b4dbc75344a342a52a15e4d6bcbfcabadae /gdb/symtab.h
parentd8aeb77f040ced7d37ab83f032b2e4ded2c81ca5 (diff)
downloadgdb-5accd1a07e080c386918da413e0f9e90c4cab58a.zip
gdb-5accd1a07e080c386918da413e0f9e90c4cab58a.tar.gz
gdb-5accd1a07e080c386918da413e0f9e90c4cab58a.tar.bz2
Remove ALL_COMPUNIT_FILETABS
This removes ALL_COMPUNIT_FILETABS, replacing its uses with ranged for loops. Because this is still used in the ALL_OBJFILE_FILETABS macro, in some places a declaration had to be removed or renamed to avoid shadowing. gdb/ChangeLog 2019-01-09 Tom Tromey <tom@tromey.com> * symtab.h (ALL_COMPUNIT_FILETABS): Remove. (compunit_filetabs): New. * symtab.c (iterate_over_some_symtabs, find_pc_sect_line): Use compunit_filetabs. (info_sources_command, make_source_files_completion_list): Remove declaration. * symmisc.c (print_objfile_statistics, dump_objfile) (maintenance_print_symbols): Remove declaration. (maintenance_info_symtabs): Use compunit_filetabs. (maintenance_info_line_tables): Likewise. * source.c (select_source_symtab): Change local variable name. (forget_cached_source_info_for_objfile): Remove declaration. * objfiles.h (ALL_OBJFILE_FILETABS): Use compunit_filetabs. * objfiles.c (objfile_relocate1): Remove declaration. * mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_files): Remove declaration. * maint.c (count_symtabs_and_blocks): Use compunit_filetabs. * coffread.c (coff_symtab_read): Remove declaration. * buildsym.c (buildsym_compunit::end_symtab_with_blockvector): Use compunit_filetabs.
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index c2d8a69..7d97372 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -29,6 +29,7 @@
#include "common/enum-flags.h"
#include "common/function-view.h"
#include "common/gdb_optional.h"
+#include "common/next-iterator.h"
#include "completer.h"
/* Opaque declarations. */
@@ -1485,10 +1486,16 @@ struct compunit_symtab
#define COMPUNIT_CALL_SITE_HTAB(cust) ((cust)->call_site_htab)
#define COMPUNIT_MACRO_TABLE(cust) ((cust)->macro_table)
-/* Iterate over all file tables (struct symtab) within a compunit. */
+/* A range adapter to allowing iterating over all the file tables
+ within a compunit. */
-#define ALL_COMPUNIT_FILETABS(cu, s) \
- for ((s) = (cu) -> filetabs; (s) != NULL; (s) = (s) -> next)
+struct compunit_filetabs : public next_adapter<struct symtab>
+{
+ compunit_filetabs (struct compunit_symtab *cu)
+ : next_adapter<struct symtab> (cu->filetabs)
+ {
+ }
+};
/* Return the primary symtab of CUST. */