[Flang-dev] new Flang discussions?

David Greene dag at cray.com
Thu Oct 11 12:20:46 EDT 2018


Roger, I share your concerns about lowering.  Higher-level Fortran
constructs should be preserved as much as possible.  I am not familiar
with how clang AST and tools work together.  Would it be possible to add
elements to clang's AST that are only used by flang?  I expect the clang
folks would object, which is why I suggested some common interface that
tooling could use.  There may be language-specific pieces to that
interface.

It's an idea and I have no idea whether it is feasible, which is why I
wanted to start the discussion and get people thinking about it before
f18 gets too far down the line.

                            -David

Roger Ferrer Ibáñez <rofirrim at gmail.com> writes:

> Hi Jeff,
>
> definitely, but I would expect a source-level tool to operate on a
> representation of the source input which hasn't undergone any lowering
> yet. If the goal is only code generation (which it isn't, for let's
> say, a checker), then I fully buy the idea of lowering things to
> C/C++.
>
> I'm a bit scared of the idea of something akin to f2c happening in the
> FE, but perhaps this is not what will happen and my concern is moot?
>
> Kind regards,
>
> Missatge de Stefan Teleman <stefan.teleman at gmail.com> del dia dj., 11
> d’oct. 2018 a les 17:29:
>
>     
>     
>     
>
>     
>     
>     On Thu, Oct 11, 2018 at 11:24 AM Roger Ferrer Ibáñez
>     <rofirrim at gmail.com> wrote:
>     
>     
>         
>         Hi Jeff,
>         
>         
>         my concern was more about the extra expressivity of Fortran in
>         some aspects compared to C/C++: things like array-sections,
>         sophisticated constructs like WHERE or FORALL, statements like
>         ALLOCATE/DEALLOCATE, the extra semantics of the DO-construct
>         when the step is nonconstant, the IO-statements might mean
>         that you end with a superset of nodes including every single
>         specific construct of the language in the AST. Sure, you can
>         lower all of them into C/C++ (and use C/C++ ASTs for that), it
>         is just I am not sure I would like to see this happen early.
>         
>         
>     
>     
>     Why?
>     
>     
>     None of the Fortran features enumerated above precludes lowering
>     to C/C++ AST.
>     
>     -- 
>     
>     
>     
>     Stefan Teleman
>     stefan.teleman at gmail.com


More information about the flang-dev mailing list