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

David Greene via llvm-dev llvm-dev at lists.llvm.org
Tue Mar 12 12:39:24 PDT 2019


David Chisnall via llvm-dev <llvm-dev at lists.llvm.org> writes:

> The main thing that springs to mind is a documentation generator.  It
> needs to be able to find comments associated with some language
> construct, index language constructs, and produce cross references.
> You would still need to have Fortran-specific support, just as you'd
> need to understand that C++ and Objective-C have different notions of
> inheritance, but a lot of the core infrastructure could be shared if
> clang and f18 exposed compatible interfaces to the AST.

Yeah.  Even if f18 doesn't use/extend the clang AST itself, it would be
nice to have some kind of abstract interface that allows tooling to get
at the common things, while providing extensions to the interface for
more language-specific things.

The ASTs can be what they want.  A shared interface to tooling might
allow some reuse.  I don't know whether a hypothetical f18-query could
reuse a lot of the clang-query engine (assuming an abstract AST
interface), but something like an f18-doc that builds on the work of
clang-doc seems like it should be possible with such an interface.

Fortran has functions (and subroutines, which for documentation purposes
are functions), modules, classes (quite different from C++, but similar
enough for documentation purposes) and aggregates.  Can all of these
things be processed in a similar way by a documentation tool using a
base library that queries a common AST interface?  Maybe?

I realize this is way beyond what the f18 team is focused on and it
would require some significant refactoring of clang tooling to allow
reuse.  Consider it a blue-sky idea to consider for future tooling
efforts.

                      -David


More information about the llvm-dev mailing list