Remove ALL_OBJFILES_SAFE

This removes the ALL_OBJFILES_SAFE macro, replacing the uses with
ranged for loops.

gdb/ChangeLog
2019-01-09  Tom Tromey  <tom@tromey.com>

	* common/next-iterator.h (next_adapter): Add Iterator template
	parameter.
	* objfiles.h (ALL_OBJFILES_SAFE): Remove.
	(class all_objfiles_safe): New.
	* jit.c (jit_inferior_exit_hook): Use all_objfiles_safe.
	* objfiles.c (put_objfile_before): Update comment.
	(add_separate_debug_objfile): Likewise.
	(free_all_objfiles): Use all_objfiles_safe.
	(objfile_purge_solibs): Likewise.
This commit is contained in:
Tom Tromey 2018-11-23 17:09:34 -07:00
parent aed57c5371
commit cac85af246
5 changed files with 49 additions and 30 deletions

View file

@ -1393,10 +1393,7 @@ jit_breakpoint_re_set (void)
static void
jit_inferior_exit_hook (struct inferior *inf)
{
struct objfile *objf;
struct objfile *temp;
ALL_OBJFILES_SAFE (objf, temp)
for (objfile *objf : all_objfiles_safe (current_program_space))
{
struct jit_objfile_data *objf_data
= (struct jit_objfile_data *) objfile_data (objf, jit_objfile_data);