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

Chris Lattner via llvm-dev llvm-dev at lists.llvm.org
Sat Mar 2 09:15:10 PST 2019



> On Mar 1, 2019, at 9:47 AM, Bruno Ricci via llvm-dev <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

Note that this stuff in Clang is entirely intertwined with the C preprocessor.  I think (?) that fortran uses the same-ish preprocessor?  If so, then this would make a lot of sense.  If not, flang could still use the llvm::SourceMgr infra.

I’d be really opposed to flang reusing the Clang ASTs themselves.  C++ is already a complicated language and mixing all of Fortran's concerns (including a completely different object model) will make both of them *worse* than having them stand alone IMO.

-Chris



More information about the llvm-dev mailing list