This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix debug info when compiling preprocessed fortran sources (.F, .F90, .F95)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Tobias Schlueter <tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Sat, 31 Dec 2005 10:59:48 -0500
- Subject: Re: [PATCH] Fix debug info when compiling preprocessed fortran sources (.F, .F90, .F95)
- References: <20051231124845.GC22293@devserv.devel.redhat.com> <43B68223.7060204@physik.uni-muenchen.de>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sat, Dec 31, 2005 at 02:05:39PM +0100, Tobias Schl?ter wrote:
> Wouldn't it be more robust (and possibly simpler) to use libcpp inside the
> Fortran frontend, and to thus do away completely with the need for a temporary
> file? I think this would be a preferable solution, but I'm sure you had
> reasons to do it this way.
When using libcpp, it already tokenizes the input. But C/C++ tokens are
very different from Fortran tokens, so you'd basically have to get tokens
from libcpp, decompose them back to the original form and parse that way.
So I don't think it is desirable to do the initial # line handling via
libcpp.
What perhaps could work is use libcpp consumer similar to the one
used for cc1 -E but instead of printing it into the output stream,
print it into buffers and handle load_file that way. But I don't think
it is worth the trouble, at least for the time being.
Jakub