You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CIL is a front-end for the C programming language that facilitates
program analysis and transformation. CIL will parse and typecheck a
program, and compile it into a simplified subset of C.
CIL supports ANSI C as well as most of the extensions of the GNU C and
Microsoft C compilers. A Perl script acts as a drop in replacement for
either gcc or Microsoft's cl, and allows merging of the source files in
your project. Other features include support for control-flow and
points-to analyses.
To build and install CIL, you need the OCaml compiler, perl, and
ocamlfind. (Of course, you also need some C compiler,
preferably gcc.)
Run the following commands to build and install CIL:
./configure
make
make test # regression test suite, optionnal
make install # as root or using sudo
If you want to install to some other directory, you can tweak the prefix
during the configure step. For instance, to install in your local opam
directory:
./configure --prefix=`opam config var prefix`
Usage
You can use cilly (installed in /usr/local/bin by default) as a drop-in
replacement for gcc to compile and link your programs.
You can also use CIL as a library to write your own programs. For
instance in the OCaml toplevel using findlib: