Giter Site home page Giter Site logo

lovejavaee / cil Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cil-project/cil

0.0 3.0 0.0 30.84 MB

C Intermediate Language

License: Other

Shell 0.77% Makefile 0.79% Perl 3.23% OCaml 55.23% C 39.73% GDB 0.01% M4 0.23% SWIG 0.01% Batchfile 0.01%

cil's Introduction

C Intermediate Language (CIL)

Linux Linux build Status Windows Windows build status

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.

Quick start

Install the latest release of CIL with opam:

opam install cil

Read the excellent CIL tutorial by Zachary Anderson, and check out the accompanying project template.

Installation

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:

$ ocaml
        Objective Caml version 4.00.1

# #use "topfind";;
[...]
# #require "cil";;
[...]
# Cil.cilVersion;;           
- : string = "1.7.3"

More documentation

The documentation is located in the doc/html/cil directory. The API documentation (generated by ocamldoc) is in the api subdirectory.

To (re)build the doc, you need Hevea and run:

make doc

You can also browse the documentation online.

Ressources

CIL is maintained by Gabriel Kerneis [email protected]

cil's People

Contributors

kerneis avatar liblit avatar pmundkur avatar jim-grundy avatar scolin avatar yakobowski avatar ctshepherd avatar egrimley-arm avatar haihaoshen avatar schwahn avatar stephenrkell avatar tbrk avatar

Watchers

James Cloos avatar Jeff M avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.