expressions: make assign_expression() take an op argument
[smatch.git] / smatch_scripts / gen_bit_shifters.sh
blob98fa30ca205bea1732eecdd67b8b26eabe269211
1 #!/bin/bash
3 file=$1
4 project=$(echo "$2" | cut -d = -f 2)
6 if [[ "$file" = "" ]] ; then
7 echo "Usage: $0 <file with smatch messages> -p=<project>"
8 exit 1
9 fi
11 bin_dir=$(dirname $0)
12 remove=$(echo ${bin_dir}/../smatch_data/${project}.bit_shifters.remove)
13 tmp=$(mktemp /tmp/smatch.XXXX)
15 echo "// list of macros used as shifters." \
16 > ${project}.bit_shifters
17 echo '// generated by `gen_bit_shifters.sh`' >> ${project}.bit_shifters
18 grep "info: bit shifter" $file | cut -s -d "'" -f 2- | sed -e "s/'//g" | sort -u > $tmp
20 cat $tmp $remove $remove 2> /dev/null | sort | uniq -u >> ${project}.bit_shifters
21 rm $tmp
22 echo "Done. List saved as '${project}.bit_shifters'"