-struct file_entered_chainon
-{
- gfc_file *file;
- struct file_entered_chainon *prev;
-};
-
-static struct file_entered_chainon *last_file_entered = NULL;
-
-static void
-start_source_file (int line, gfc_file *file)
-{
- struct file_entered_chainon *f = gfc_getmem (sizeof
- (struct file_entered_chainon));
-
- f->file = file;
- f->prev = last_file_entered;
- last_file_entered = f;
-
- (*debug_hooks->start_source_file) (line, file->filename);
-}
-
-static void
-end_source_file (int line)
-{
- gcc_assert (last_file_entered);
- last_file_entered = last_file_entered->prev;
- (*debug_hooks->end_source_file) (line);
-}
-
-static void
-exit_remaining_files (void)
-{
- struct file_entered_chainon *f = last_file_entered;
- while (f)
- {
- /* The line number doesn't matter much, because we're at the end of
- the toplevel file anyway. */
- (*debug_hooks->end_source_file) (0);
-
- f = f->prev;
- }
-}
-