GitHub - AdaCore/gnat-llvm: LLVM based GNAT compiler (original) (raw)

GNAT LLVM

This is an Ada compiler based on LLVM, connecting the GNAT front-end to the LLVM code generator to generate LLVM bitcode for Ada and to open the LLVM ecosystem to Ada.

Note that we are not planning on replacing any existing GNAT port that's based on GCC: this project is meant to provide additional, not replacement, GNAT ports.

You are welcome to experiment with this technology and provide feedback on successes, usages, limitations, pull requests, etc.

Building

To build GNAT LLVM from sources, follow these steps:

$ git clone https://github.com/AdaCore/gnat-llvm.git  
$ cd gnat-llvm  
$ git clone git://gcc.gnu.org/git/gcc.git llvm-interface/gcc  

then under non Windows systems:

$ ln -s gcc/gcc/ada llvm-interface/gnat_src  

under Windows systems:

$ mv llvm-interface/gcc/gcc/ada llvm-interface/gnat_src  
$ git clone https://github.com/AdaCore/llvm-bindings.git  

Usage

$ gdb -args llvm-gnat1 -c file.adb  
$ llvm-gcc -c -emit-llvm file.adb  
$ llvm-gcc -c -S -emit-llvm file.adb  

License

The GNAT LLVM tool is licensed under the GNU General Public License version 3 or later; see file COPYING3 for details.