The SetC Compiler

This language, coded in OCaml, is derived from C and compiled into LLVM IR.i 

It needs the OCaml llvm library, which is most easily installed through
opam.

Install LLVM and its development libraries, the m4 macro preprocessor,
and opam, then use opam to install llvm.

The version of the OCaml llvm library should match the version of the LLVM
system installed on your system.

testall.sh runs the setc executable on each testcase (.sc file) to produce 
a .ll file, invokes "llc" (the LLVM compiler) to produce a .s (assembly) 
file, then invokes "cc" (the stock C compiler) to assemble the .s file, 
link in any .o files, and generate an executable.  See testall.sh for details.

--------------------------------

Installation under Ubuntu 15.10

LLVM 3.6 is the default under 15.10, so we ask for a matching version of the
OCaml library.

sudo apt-get install -y ocaml m4 llvm opam
opam init
opam install llvm.3.6 ocamlfind
eval `opam config env`

make
./testall.sh

-------------------------------
To run and test: 

$ make 
ocamlbuild -use-ocamlfind -pkgs llvm,llvm.analysis -cflags -w,+a-4 \
  setc.native
  Finished, 28 targets (0 cached) in 00:00:05.
  cc    -c -o strcmp.o strcmp.c
  cc    -c -o stdlib.o stdlib.c
$ ./testall.sh
test-add...OK
test-add1...OK
test-append-float...OK
test-append...OK
test-append1...OK
...
fail-set3...OK
fail-while1...OK
fail-while2...OK


