[LLVMdev] CIL 1.3.7 release, with experimental LLVM code generation

David Gay dgay42 at gmail.com
Fri Apr 24 12:12:40 PDT 2009


The latest release of the CIL C frontend (http://sf.net/projects/cil)
now includes a module to generate LLVM assembly code from CIL's
intermediate format. It should be considered alpha-level code and
still has a number of significant limitations:

   It is targeted to the 32-bit mode of x86 processors using gcc's C
dialect. It handles all of C, except:
     - bitfields
     - inline assembly code
     - gcc pragmas/attributes (those not handled by CIL directly)
     - variable-size types
     - <whatever bugs are lurking in there>

I have however successfully used it to compile some small but real programs...

Some test cases showing how to use this extension are on my web page, at
  http://berkeley.intel-research.net/dgay/cil-llvm-tests.tar.gz
You can use these with CIL as follows:
  cd cil-1.3.7; tar xfz cil-llvm-tests.tar.gz # extract tests in CIL
  ./configure --with-llvm; make # build CIL with llvm support
  cd tests/llvm
  make # run simple LLVM tests
  make cfrac # run a larger LLVM test

Disclaimer: this works for me on Mac OS X 10.4 and on a Linux CentOS
machine, with LLVM 2.5. YMMV...

Please submit bug reports, or improvements (e.g. removing some of the
limitations above ;-)) via CIL's sourceforge bug tracker, at
https://sourceforge.net/tracker/?group_id=138953&atid=742140

--
David Gay



More information about the llvm-dev mailing list