simple heuristic to reuse stack slots
[qbe.git] / minic / mcc
blobc8d500edd694ffd7812fcc65da3890d303c50ddf
1 #!/bin/sh
3 DIR=`cd $(dirname $0); pwd`
4 QBE=$DIR/../obj/qbe
6 usage()
8 echo "usage: mcc [LDFLAGS] file.c" >&2
9 exit 1
12 for i
14 case $i in
15 -*)
16 flags="$flags $i"
19 if ! test -z $file
20 then
21 usage
23 file=$i
25 esac
26 done
28 if test -z $file
29 then
30 usage
34 $DIR/minic < $file > /tmp/minic.ssa &&
35 $QBE < /tmp/minic.ssa > /tmp/minic.s &&
36 cc $flags /tmp/minic.s
38 if test $? -ne 0
39 then
40 echo "error processing file $file" >&2
41 exit 1