aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sparsec
diff options
authorPekka Enberg <penberg@kernel.org>2011-08-23 17:11:44 +0300
committerPekka Enberg <penberg@kernel.org>2011-08-23 17:40:41 +0300
commit45a6fbff825047582979c93ca363d8483122c3d5 (patch)
tree278f064f2ba6b30991841ddab15c6596da0fb57b /sparsec
parentcfcf8b5d5c1075c27ebb751946d1f19cdc77fe17 (diff)
downloadsparse-dev-45a6fbff825047582979c93ca363d8483122c3d5.tar.gz
sparse, llvm: Initial commit
This is the first commit to implementing a LLVM backend for sparse using the LLVM C bindings. Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'sparsec')
-rwxr-xr-xsparsec31
1 files changed, 31 insertions, 0 deletions
diff --git a/sparsec b/sparsec
new file mode 100755
index 00000000..5ae4bb8d
--- /dev/null
+++ b/sparsec
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# GCC compatible C compiler based on Sparse LLVM
+
+SPARSEOPTS=""
+ASOPTS=""
+DIRNAME=`dirname $0`
+
+use_gcc=1
+
+while [ $# -gt 0 ]; do
+ case $1 in
+ '-o')
+ ASOPTS=$ASOPTS"-o "$2" "
+ shift
+ ;;
+ '-c')
+ use_gcc=0
+ ;;
+ *)
+ SPARSEOPTS="$SPARSEOPTS $1 " ;;
+ esac
+ shift
+done
+
+if [ $use_gcc -eq 1 ]; then
+ gcc $ASOPTS $SPARSEOPTS
+
+else
+ sparse-llvm $SPARSEOPTS | llc | as $ASOPTS
+fi