8 if (!defined($warns)) {
9 print "usage: $0 <warns.txt>\n";
13 my $db = DBI
->connect("dbi:SQLite:smatch_db.sqlite", "", "", {AutoCommit
=> 0});
14 $db->do("PRAGMA synchronous = OFF");
15 $db->do("PRAGMA cache_size = 800000");
16 $db->do("PRAGMA journal_mode = OFF");
18 $db->do("delete from call_implies");
20 my $type = 6; # DEREFERENCE
21 open(WARNS
, "<$warns");
23 if (!($_ =~ /info: dereferences_param /)) {
29 my ($file_and_line, $file, $func, $dummy, $param, $value, $gs);
31 # fs/buffer.c:62 list_add() info: dereferences_param 1 static
34 ($file_and_line, $func, $dummy, $dummy, $param, $gs) = split(/ /, $_);
35 ($file, $dummy) = split(/:/, $file_and_line);
38 if (!defined($param)) {
43 if ($gs =~ /static/) {
47 # print "insert into call_implies values ('$file', '$func', $static, $type, $param, $value)\n";
48 $db->do("insert into call_implies values ('$file', '$func', $static, $type, $param, $value)");