[llvm-dev] RFC for f18+runtimes in LLVM

Bruno Ricci via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 1 14:28:06 PST 2019


Hi Steve,

This seems reasonable to me. I didn't think it would be possible to reuse
the preprocessor or the AST for exactly the same reason you mention
(similar from far enough but lots of differences in the details). Thank you
for you answer.

Bruno

On Fri, 1 Mar 2019, 22:13 Stephen Scalpone, <sscalpone at nvidia.com> wrote:

> Hi Bruno, Troy,
>
> We looked early on at reusing the preprocessor and other source-file
> utilities from clang.  It turns out that while preprocessors look similar
> on the surface, preprocessors are deeply integrated with their source
> language and take into account many language syntax rules.  In the f18
> documentation we have two documents that dive into more details about the
> differences between C and Fortran and the nuances of the preprocessor.
>
> We thought we might be able to reuse the clang diagnostic infrastructure,
> but upon looking at the code we saw a lot of very specific C/C++
> information in that code, which seems very natural to want to keep as much
> semantic information as possible for error messages.  In the end, it seemed
> impractical to try to map Fortran entities to C/C++ objects just for the
> diagnostic infrastructure.
>
>  - Steve
>
> On 3/1/19, 9:47 AM, "llvm-dev on behalf of Bruno Ricci via llvm-dev" <
> llvm-dev-bounces at lists.llvm.org on behalf of llvm-dev at lists.llvm.org>
> wrote:
>
>
>
>     On 01/03/2019 17:26, Troy Johnson via llvm-dev wrote:
>     > This RFC started a good discussion and I’d like to hear responses
> from its author
>     > to all of the points that have been made so far.
>     >
>     >
>     >
>     > FWIW, I’m also in favor of reusing as much from Clang as practical.
> In fact, with> the combined repo now, it might make sense to factor out
> some common front end code
>     > that both a Clang and any Flang (f18 or Fort) would use, for
> maintainability as well
>     > as to avoid the perceived strangeness of a Fortran front end relying
> on a C front end.
>
>     What part of the frontend do you think could be shared ? At least the
> following seems
>     to be re-usable:
>
>     - The diagnostics infrastructure
>     - IdentifierTable
>     - The file manager and source location infrastructure
>
>     Bruno
>     _______________________________________________
>     LLVM Developers mailing list
>     llvm-dev at lists.llvm.org
>     https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
>
>
> -----------------------------------------------------------------------------------
> This email message is for the sole use of the intended recipient(s) and
> may contain
> confidential information.  Any unauthorized review, use, disclosure or
> distribution
> is prohibited.  If you are not the intended recipient, please contact the
> sender by
> reply email and destroy all copies of the original message.
>
> -----------------------------------------------------------------------------------
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190301/db65c6f6/attachment.html>


More information about the llvm-dev mailing list