type_value: speed up loading the database
[smatch.git] / smatch_data / db / create_db.sh
blob4216382dc9b20384727ad04ae68ed907865d118d
1 #!/bin/bash
3 if echo $1 | grep -q '^-p' ; then
4 PROJ=$(echo $1 | cut -d = -f 2)
5 shift
6 fi
8 info_file=$1
10 if [[ "$info_file" = "" ]] ; then
11 echo "Usage: $0 -p=<project> <file with smatch messages>"
12 exit 1
15 bin_dir=$(dirname $0)
16 db_file=smatch_db.sqlite.new
18 rm -f $db_file
20 for i in ${bin_dir}/*.schema ; do
21 cat $i | sqlite3 $db_file
22 done
24 for i in ${bin_dir}/fill_* ; do
25 $i "$PROJ" $info_file $db_file
26 done
28 cat ${bin_dir}/function_type_value.idx | sqlite3 $db_file
29 ${bin_dir}/load_db_type_value.pl "$PROJ" $info_file $db_file
31 ${bin_dir}/fixup_all.sh $db_file
32 if [ "$PROJ" != "" ] ; then
33 ${bin_dir}/fixup_${PROJ}.sh $db_file
36 for i in ${bin_dir}/*.idx ; do
37 cat $i | sqlite3 $db_file
38 done
40 ${bin_dir}/remove_mixed_up_pointer_params.pl $db_file
41 ${bin_dir}/mark_function_ptrs_searchable.pl $db_file
43 mv $db_file smatch_db.sqlite