6 # Functions in public header don't get the noinline annotation
7 # so whitelist them here
8 $noninlined{"virEventAddTimeout"} = 1;
9 # This one confuses the script as its defined in the mock file
10 # but is actually just a local helper
11 $noninlined{"virMockStatRedirect"} = 1;
13 foreach my $arg (@ARGV) {
15 #print "Scan header $arg\n";
16 &scan_annotations
($arg);
17 } elsif ($arg =~ /mock\.c$/) {
18 #print "Scan mock $arg\n";
19 &scan_overrides
($arg);
24 foreach my $func (keys %mocked) {
25 next if exists $noninlined{$func};
28 print STDERR
"$func is mocked at $mocked{$func} but missing noinline annotation\n";
34 sub scan_annotations
{
37 open FH
, $file or die "cannot read $file: $!";
41 if (/^\s*(\w+)\(/ || /^(?:\w+\*?\s+)+(?:\*\s*)?(\w+)\(/) {
43 if ($name !~ /ATTRIBUTE/) {
49 if (/ATTRIBUTE_NOINLINE/) {
51 $noninlined{$func} = 1;
62 open FH
, $file or die "cannot read $file: $!";
66 if (/^(\w+)\(/ || /^\w+\s*(?:\*\s*)?(\w+)\(/) {
68 if ($name =~ /^vir/) {
69 $mocked{$name} = "$file:$.";