[LLVMdev] LLVM + FORTRAN 95

Nilesh Mahajan nnmahaja at umail.iu.edu
Tue Nov 3 15:24:57 PST 2009


Hi David/Renato,

By AST I mean Abstract Syntax Tree. We are writing an optimization
pass for some FORTRAN95 + MPI code that requires us to analyze the
AST. We thought of 2 ways of doing this:
1. Compile the code using Clang/llvm-gfortran, get the textual AST
dump (somehow), analyze the AST dump using Ruby, modify it and then
feed back the modified AST to LLVM.
2. Do the analysis as an LLVM module.
>From your comments, I get the feeling that 2nd option is the better option.

Thanks for your responses!
Nilesh.

P.S. Does anybody have an idea about the 'llvm-gcc: error trying to
exec 'cc1': execvp: No such file or directory' error?

On Tue, Nov 3, 2009 at 5:11 PM, Renato Golin <rengolin at systemcall.org> wrote:
> 2009/11/3 David Greene <dag at cray.com>:
>> Your best bet is to use llvm-gfortran.  I don't know what you mean by
>> "AST."  Do you really want an AST or something else (LLVM IR, something
>> higher-level, etc.)?  LLVM doesn't understand ASTs directly.
>
> Probably for high-level optimisations, or just to see if the parser is
> good, as I do in my compiler.
>
> But AST is language/compiler specific, I also recommend you to
> transform everything to LLVM IR and do your stuff there. The LLVM IR
> is more high level and extremely more expressive (types and
> everything) than GCC IR, so you probably get everything you want from
> there.
>
>
>> Longer term, it sure would be nice to have flang.  :)
>
> That supports HPF!! Yeah!
>
> cheers,
> --renato
>
> Reclaim your digital rights, eliminate DRM, learn more at
> http://www.defectivebydesign.org/what_is_drm
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list