type: simplify get_binop_type()
[smatch.git] / smatch_scripts / gen_unwind_functions.sh
blob12f2546ef205ad09a0b45fda580c2b63510f29ba
1 #!/bin/bash
3 file=$1
5 if [[ "$file" = "" ]] ; then
6 echo "Usage: $0 <file with smatch messages>"
7 exit 1
8 fi
10 outfile="kernel.unwind_functions"
11 bin_dir=$(dirname $0)
12 remove=$(echo ${bin_dir}/../smatch_data/${outfile}.remove)
13 tmp=$(mktemp /tmp/smatch.XXXX)
14 tmp2=$(mktemp /tmp/smatch.XXXX)
16 echo "// list of unwind functions." > $outfile
17 echo '// generated by `gen_unwind_functions.sh`' >> $outfile
18 grep "is unwind function" $file | cut -d ' ' -f 2 | cut -d '(' -f 1 >> $tmp
19 cat $tmp | sort -u > $tmp2
20 mv $tmp2 $tmp
21 cat $tmp $remove $remove 2> /dev/null | sort | uniq -u >> $outfile
22 rm $tmp
23 echo "Done. List saved as '$outfile'"