[PATCH] Fix debug info when compiling preprocessed fortran sources (.F, .F90, .F95)

Tobias Schlüter tobias.schlueter@physik.uni-muenchen.de
Wed Jan 25 22:19:00 GMT 2006


Jakub Jelinek wrote:
> 2005-12-31  Jakub Jelinek  <jakub@redhat.com>
> 
> 	* Make-lang.in (fortran/scanner.o): Depend on toplev.h.
> 	* lang.opt (fpreprocessed): New option.
> 	* scanner.c: Include toplev.h.
> 	(gfc_src_file, gfc_src_preprocessor_lines): New variables.
> 	(preprocessor_line): Unescape filename if there were any
> 	backslashes.
> 	(load_file): If initial and gfc_src_file is not NULL,
> 	use it rather than opening the file.  If gfc_src_preprocessor_lines
> 	has non-NULL elements, pass it to preprocessor_line.
> 	(unescape_filename, gfc_read_orig_filename): New functions.
> 	* gfortran.h (gfc_option_t): Add flag_preprocessed.
> 	(gfc_read_orig_filename): New prototype.
> 	* options.c (gfc_init_options): Clear flag_preprocessed.
> 	(gfc_post_options): If flag_preprocessed, call
> 	gfc_read_orig_filename.
> 	(gfc_handle_option): Handle OPT_fpreprocessed.
> 	* lang-specs.h: Pass -fpreprocessed to f951 if preprocessing
> 	sources.

Sorry for not approving this earlier; as I said before, I'm not to keen of
this approach, but that's what we have.  This is ok for the mainline, and
possibly for 4.1, IIRC g77 got this wrong as well.

- Tobi



More information about the Gcc-patches mailing list