Make psymtab range adapter a method on objfile

This removes the objfile_psymtabs class in favor of a method on
objfile and on psymtab_storage.

2019-01-16  Tom Tromey  <tom@tromey.com>

	* objfiles.h (struct objfile) <psymtabs>: New method.
	(class objfile_psymtabs): Remove.
	* psymtab.h (class psymtab_storage) <partial_symtab_range>: New
	typedef.
	<range>: New method.
	(require_partial_symbols): Change return type.
	* psymtab.c (require_partial_symbols)
	(psym_expand_symtabs_matching): Update.
	* mdebugread.c (parse_partial_symbols): Update.
	* dbxread.c (dbx_end_psymtab): Update.
This commit is contained in:
Tom Tromey
2019-01-16 06:37:15 -07:00
parent b669c95337
commit f252c6d5dc
6 changed files with 38 additions and 21 deletions

View File

@ -293,6 +293,14 @@ struct objfile
DISABLE_COPY_AND_ASSIGN (objfile);
/* A range adapter that makes it possible to iterate over all
psymtabs in one objfile. */
psymtab_storage::partial_symtab_range psymtabs ()
{
return partial_symtabs->range ();
}
/* Reset the storage for the partial symbol tables. */
void reset_psymtabs ()
@ -642,19 +650,6 @@ private:
struct objfile *m_objfile;
};
/* A range adapter that makes it possible to iterate over all
psymtabs in one objfile. */
class objfile_psymtabs : public next_adapter<struct partial_symtab>
{
public:
explicit objfile_psymtabs (struct objfile *objfile)
: next_adapter<struct partial_symtab> (objfile->partial_symtabs->psymtabs)
{
}
};
#define ALL_OBJFILE_OSECTIONS(objfile, osect) \
for (osect = objfile->sections; osect < objfile->sections_end; osect++) \
if (osect->the_bfd_section == NULL) \