diff options
| author | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-15 17:31:32 +0000 |
|---|---|---|
| committer | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-05-15 17:31:32 +0000 |
| commit | b0057e95fbd739a367c67164d1107f5d955dfcd8 (patch) | |
| tree | 78eca888e2f4be9f6b0c5e4db6a69c5180d050c6 /gcc/fortran/module.c | |
| parent | 1eb397b0a23e2a60bae64ee80c76f005199d807e (diff) | |
| download | ppe42-gcc-b0057e95fbd739a367c67164d1107f5d955dfcd8.tar.gz ppe42-gcc-b0057e95fbd739a367c67164d1107f5d955dfcd8.zip | |
PR fortran/13702
(Port from g95)
* gfortran.h (gfc_linebuf): New typedef.
(linebuf): Remove.
(gfc_file): Revamped, use new gfc_linebuf.
(locus): Revamped, use new types.
(gfc_current_file): Remove.
(gfc_current_form, gfc_source_file): New global variables.
* match.c (gfc_match_space, gfc_match_strings): Use
gfc_current_form to find source form.
* module.c (gfc_dump_module): Use gfc_source_file when printing
module header.
* error.c (show_locus, show_loci) Use new data structures to print
locus.
* scanner.c (first_file, first_duplicated_file, gfc_current_file):
Remove.
(file_head, current_file, gfc_current_form, line_head, line_tail,
gfc_current_locus1, gfc_source_file): New global variables.
(gfc_scanner_init1): Set new global variables.
(gfc_scanner_done1): Free new data structures.
(gfc_current_locus): Return pointer to gfc_current_locus1.
(gfc_set_locus): Set gfc_current_locus1.
(gfc_at_eof): Set new variables.
(gfc_at_bol, gfc_at_eol, gfc_advance_line, gfc_next_char): Adapt
to new locus structure.
(gfc_check_include): Remove.
(skip_free_comments, skip_fixed_comments): Use gfc_current_locus1.
(gfc_skip_comments): Use gfc_current_form, find locus with
gfc_current_locus1.
(gfc_next_char): Use gfc_current_form.
(gfc_peek_char, gfc_gobble_whitespace): Use gfc_current_locus1.
(load_line): Use gfc_current_form. Recognize ^Z as EOF. Fix
comment formatting.
(get_file): New function.
(preprocessor_line, include_line): New functions.
(load_file): Move down, rewrite to match new data structures.
(gfc_new_file): Rewrite to match new data structures.
* parse.c (next_statement): Remove code which is now useless. Use
gfc_source_form and gfc_source_file where appropriate.
* trans-decl.c (gfc_get_label_decl): adapt to new data structures
when determining locus of frontend code.
* trans-io.c (set_error_locus): Same.
* trans.c (gfc_get_backend_locus, gfc_set_backend_locus): Likewise.
* lang-specs.h (@f77-cpp-input, @f95-cpp-input): Remove '-P' from
preprocessor flags.
(all): Add missing initializers.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@81888 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/module.c')
| -rw-r--r-- | gcc/fortran/module.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/gcc/fortran/module.c b/gcc/fortran/module.c index 566e3f330c7..1143705a1d9 100644 --- a/gcc/fortran/module.c +++ b/gcc/fortran/module.c @@ -3338,7 +3338,6 @@ void gfc_dump_module (const char *name, int dump_flag) { char filename[PATH_MAX], *p; - gfc_file *g; time_t now; filename[0] = '\0'; @@ -3359,17 +3358,13 @@ gfc_dump_module (const char *name, int dump_flag) gfc_fatal_error ("Can't open module file '%s' for writing: %s", filename, strerror (errno)); - /* Find the top level filename. */ - g = gfc_current_file; - while (g->next) - g = g->next; - now = time (NULL); p = ctime (&now); *strchr (p, '\n') = '\0'; - fprintf (module_fp, "GFORTRAN module created from %s on %s\n", g->filename, p); + fprintf (module_fp, "GFORTRAN module created from %s on %s\n", + gfc_source_file, p); fputs ("If you edit this, you'll get what you deserve.\n\n", module_fp); iomode = IO_OUTPUT; |

