sparse, llvm: Code generation for string constants
[smatch.git] / sparsec
blob26062e1e5c3d6c5501d40b492a74328b9952fc8d
1 #!/bin/sh
3 # GCC compatible C compiler based on Sparse LLVM
5 SPARSEOPTS=""
6 ASOPTS=""
7 DIRNAME=`dirname $0`
9 use_gcc=1
11 while [ $# -gt 0 ]; do
12 case $1 in
13 '-o')
14 ASOPTS=$ASOPTS"-o "$2" "
15 shift
17 '-c')
18 use_gcc=0
21 SPARSEOPTS="$SPARSEOPTS $1 " ;;
22 esac
23 shift
24 done
26 if [ $use_gcc -eq 1 ]; then
27 echo "Unsupported options, falling back to GCC..."
28 gcc $ASOPTS $SPARSEOPTS
30 else
31 $DIRNAME/sparse-llvm $SPARSEOPTS | llc | as $ASOPTS