/* It still may reference data modules have associated with the objfile and
      the symbol file data.  */
-  forget_cached_source_info_for_objfile (this);
+  forget_cached_source_info ();
 
   breakpoint_free_objfile (this);
   btrace_free_objfile (this);
 
 
 /* See source.h.  */
 
-void
-forget_cached_source_info_for_objfile (struct objfile *objfile)
-{
-  for (compunit_symtab *cu : objfile->compunits ())
-    {
-      for (symtab *s : cu->filetabs ())
-       {
-         if (s->fullname != NULL)
-           {
-             xfree (s->fullname);
-             s->fullname = NULL;
-           }
-       }
-    }
-
-  objfile->forget_cached_source_info ();
-}
-
-/* See source.h.  */
-
 void
 forget_cached_source_info (void)
 {
   for (struct program_space *pspace : program_spaces)
     for (objfile *objfile : pspace->objfiles ())
-      {
-       forget_cached_source_info_for_objfile (objfile);
-      }
+      objfile->forget_cached_source_info ();
 
   g_source_cache.clear ();
   last_source_visited = NULL;
 
 extern void print_source_lines (struct symtab *s, source_lines_range r,
                                print_source_lines_flags flags);
 
-/* Forget line positions and file names for the symtabs in a
-   particular objfile.  */
-extern void forget_cached_source_info_for_objfile (struct objfile *);
-
 /* Forget what we learned about line positions in source files, and
    which directories contain them; must check again now since files
    may be found in a different directory now.  */
 
     gdb_printf (gdb_stdlog, "qf->forget_cached_source_info (%s)\n",
                objfile_debug_name (this));
 
+  for (compunit_symtab *cu : compunits ())
+    {
+      for (symtab *s : cu->filetabs ())
+       {
+         if (s->fullname != NULL)
+           {
+             xfree (s->fullname);
+             s->fullname = NULL;
+           }
+       }
+    }
+
   for (const auto &iter : qf_require_partial_symbols ())
     iter->forget_cached_source_info (this);
 }