Coder Social home page Coder Social logo

n0w0rk / goblint-cil Goto Github PK

View Code? Open in Web Editor NEW

This project forked from goblint/cil

0.0 0.0 0.0 32.18 MB

C Intermediate Language

Home Page: https://goblint.github.io/cil/

License: Other

Shell 0.22% Perl 3.64% C 41.39% OCaml 54.25% Makefile 0.48% Batchfile 0.01% GDB 0.01% SWIG 0.01%

goblint-cil's Introduction

C Intermediate Language (CIL)

tests workflow status docs workflow status GitHub release status opam package 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.

goblint-cil is a fork of CIL that supports C99, C11 as well as most of the extensions of the GNU C. It makes many changes to the original CIL in an effort to modernize it and keep up with the latest versions of the C language. Here is an incomplete list of some of the ways goblint-cil improves upon CIL:

  • Support for C99 and C11.
  • Compatibility with modern OCaml versions.
  • Use Zarith instead of Num and use that for integer constants.
  • Improved locations with columns and spans.
  • Removal of unmaintained extensions and MSVC support.
  • Use dune instead of make and ocamlbuild.
  • Many bug fixes.

Quickstart

Install the latest release of goblint-cil with opam:

opam install goblint-cil

Read the excellent CIL tutorial by Zachary Anderson, much of which still applies to goblint-cil. The repository referenced in that document has now moved here.

ATTENTION: Don't install the cil package. This is the unmaintained original version of CIL.

Installation from Source

Prerequisites:

  • opam
  • GCC
  • Perl

First create a local opam switch and install all dependencies:

opam switch create .

Then, you can use dune to build goblint-cil. Run the following commands to build and test goblint-cil:

dune build
dune runtest    # runs the regression test suite

To run a single test go to the build directory (e.g. _build/default/test) and run e.g.:

dune exec -- make test/array1

You can also install goblint-cil into the opam switch:

dune build @install
dune install

Usage

You can use cilly (installed in the opam switch) as a drop-in replacement for gcc to compile and link your programs.

You can also use goblint-cil as a library to write your own programs. For instance in the OCaml toplevel using Findlib:

$ ocaml
OCaml version 4.14.0

# #use "topfind";;
[...]
# #require "goblint-cil";;
[...]
# GoblintCil.cilVersion;;
- : string = "2.0.2"

License

goblint-cil is licensed under the BSD license. See LICENSE.

goblint-cil's People

Contributors

michael-schwarz avatar kerneis avatar sim642 avatar vogler avatar stilscher avatar keremc avatar liblit avatar pmundkur avatar jerhard avatar just-max avatar faddeenkov avatar vesalvojdani avatar karoliineh avatar scolin avatar jim-grundy avatar coslu avatar yakobowski avatar ctshepherd avatar egrimley-arm avatar edwintorok avatar haihaoshen avatar med3attia97 avatar stephenrkell avatar tkchia avatar tbrk avatar emiljapelt avatar

goblint-cil's Issues

One command to rule them all

inside goblint-cil/src:
dune exec -- ./main.exe test_asm.c --verbose --live_debug --printCilAsIs --out cil.out && cat cil.out

Assembly Context Statements

Each Assembly statement is translated into an instruction. Those instructions need to reference the context of the assembly block. To prevent multiple visits to the same context, context should be implemented as dummy statement without controlflow wich can be referenced by each assembly instruction.
This has to be a reference so it can be mutable.
Fields also may have to be mutable. (location, the rest probably not)

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.