diff options
author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2004-05-15 19:31:32 +0200 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2004-05-15 19:31:32 +0200 |
commit | d4fa05b90d6647ceaf50b5f1b8504fc0e01fae9c (patch) | |
tree | 78eca888e2f4be9f6b0c5e4db6a69c5180d050c6 /gcc/fortran/lang-specs.h | |
parent | 39ae2b013af4a6a8fbdd8bc2ee72cdda174e0d95 (diff) | |
download | gcc-d4fa05b90d6647ceaf50b5f1b8504fc0e01fae9c.zip gcc-d4fa05b90d6647ceaf50b5f1b8504fc0e01fae9c.tar.gz gcc-d4fa05b90d6647ceaf50b5f1b8504fc0e01fae9c.tar.bz2 |
re PR fortran/13702 (When preprocessing Fortran files (.F, .F90 and .F95) cpp should emit line numbers.)
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.
From-SVN: r81888
Diffstat (limited to 'gcc/fortran/lang-specs.h')
-rw-r--r-- | gcc/fortran/lang-specs.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/gcc/fortran/lang-specs.h b/gcc/fortran/lang-specs.h index f1828e2..b18483f 100644 --- a/gcc/fortran/lang-specs.h +++ b/gcc/fortran/lang-specs.h @@ -7,29 +7,29 @@ This file is licensed under the GPL. */ /* This is the contribution to the `default_compilers' array in gcc.c for the f95 language. */ -{".F", "@f77-cpp-input", 0}, -{".fpp", "@f77-cpp-input", 0}, -{".FPP", "@f77-cpp-input", 0}, +{".F", "@f77-cpp-input", 0, 0, 0}, +{".fpp", "@f77-cpp-input", 0, 0, 0}, +{".FPP", "@f77-cpp-input", 0, 0, 0}, {"@f77-cpp-input", - "cc1 -P -E -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \ + "cc1 -E -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \ %{E|M|MM:%(cpp_debug_options)}\ %{!M:%{!MM:%{!E: -o %|.f |\n\ f951 %|.f %{!ffree-form:-ffixed-form} %(cc1_options) %{J*} %{I*}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0}, -{".F90", "@f95-cpp-input", 0}, -{".F95", "@f95-cpp-input", 0}, + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, +{".F90", "@f95-cpp-input", 0, 0, 0}, +{".F95", "@f95-cpp-input", 0, 0, 0}, {"@f95-cpp-input", - "cc1 -P -E -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \ + "cc1 -E -traditional-cpp -D_LANGUAGE_FORTRAN %(cpp_options) \ %{E|M|MM:%(cpp_debug_options)}\ %{!M:%{!MM:%{!E: -o %|.f95 |\n\ f951 %|.f95 %(cc1_options) %{J*} %{I*}\ - %{!fsyntax-only:%(invoke_as)}}}}", 0}, -{".f90", "@f95", 0}, -{".f95", "@f95", 0}, + %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0}, +{".f90", "@f95", 0, 0, 0}, +{".f95", "@f95", 0, 0, 0}, {"@f95", "%{!E:f951 %i %(cc1_options) %{J*} %{I*}\ - %{!fsyntax-only:%(invoke_as)}}", 0}, -{".f", "@f77", 0}, -{".for", "@f77", 0}, -{".FOR", "@f77", 0}, + %{!fsyntax-only:%(invoke_as)}}", 0, 0, 0}, +{".f", "@f77", 0, 0, 0}, +{".for", "@f77", 0, 0, 0}, +{".FOR", "@f77", 0, 0, 0}, {"@f77", "%{!E:f951 %i %{!ffree-form:-ffixed-form} %(cc1_options) %{J*} %{I*}\ - %{!fsyntax-only:%(invoke_as)}}", 0}, + %{!fsyntax-only:%(invoke_as)}}", 0, 0, 0}, |