It seemed cleaner to me for compunit_symtab to have a
forget_cached_source_info method, then for the objfile to know how to
do this.
objfile_debug_name (this));
for (compunit_symtab *cu : compunits ())
- {
- for (symtab *s : cu->filetabs ())
- s->release_fullname ();
- }
+ cu->forget_cached_source_info ();
for (const auto &iter : qf)
iter->forget_cached_source_info (this);
return symtab->language ();
}
+/* See symtab.h. */
+
+void
+compunit_symtab::forget_cached_source_info ()
+{
+ for (symtab *s : filetabs ())
+ s->release_fullname ();
+}
+
/* The relocated address of the minimal symbol, using the section
offsets from OBJFILE. */
/* Return the language of this compunit_symtab. */
enum language language () const;
+ /* Clear any cached source file names. */
+ void forget_cached_source_info ();
+
/* Unordered chain of all compunit symtabs of this objfile. */
struct compunit_symtab *next;