Hi all, I want to compile FORTRAN 95 code with LLVM. More specifically, I would like to get an AST dump of the program I compile, statically analyze the AST, make modifcations to the AST and then feed it back to LLVM. Do you have any hints as to how I should proceed about doing this. I noticed that clang has an ast-dump option but don't know whether it supports FORTRAN 95. I am a LLVM newbie and I am trying to install it on Linux. I followed the setup instructions carefully but I am still facing the following error when trying to compile a simple hello.c: llvm-gcc: error trying to exec 'cc1': execvp: No such file or directory Can anybody help me here? Also I am not sure if I should post these kind of questions to a different mailing list. Thanks, Nilesh.
On Tuesday 03 November 2009 15:29, Nilesh Mahajan wrote:> Hi all, > > I want to compile FORTRAN 95 code with LLVM. More specifically, I > would like to get an AST dump of the program I compile, statically > analyze the AST, make modifcations to the AST and then feed it back to > LLVM. Do you have any hints as to how I should proceed about doing > this. I noticed that clang has an ast-dump option but don't know > whether it supports FORTRAN 95.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. Longer term, it sure would be nice to have flang. :) -Dave
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