singleuse: make git grep faster, add Apple nm support
- avoid regexp in grep to make it run faster. - add support for parsing Apple `nm` output: - skip leading underscore from function names. - pick object name from output. Closes #15070
This commit is contained in:
parent
f0f9e2c61f
commit
fcc89619d9
@ -152,7 +152,7 @@ my %api = (
|
||||
|
||||
sub doublecheck {
|
||||
my ($f, $used) = @_;
|
||||
open(F, "git grep -le '$f\\W' -- lib ${unittests}packages|");
|
||||
open(F, "git grep -Fwle '$f' -- lib ${unittests}packages|");
|
||||
my @also;
|
||||
while(<F>) {
|
||||
my $e = $_;
|
||||
@ -180,13 +180,17 @@ while (<N>) {
|
||||
if($l =~ /^([0-9a-z_-]+)\.o:/) {
|
||||
$file = $1;
|
||||
}
|
||||
if($l =~ /^([0-9a-f]+) T (.*)/) {
|
||||
# libcurl.a(unity_0_c.c.o):
|
||||
elsif($l =~ /\(([0-9a-z_.-]+)\.o\):/) { # Apple nm
|
||||
$file = $1;
|
||||
}
|
||||
if($l =~ /^([0-9a-f]+) T _?(.*)/) {
|
||||
my ($name)=($2);
|
||||
#print "Define $name in $file\n";
|
||||
$file =~ s/^libcurl_la-//;
|
||||
$exist{$name} = $file;
|
||||
}
|
||||
elsif($l =~ /^ U (.*)/) {
|
||||
elsif($l =~ /^ U _?(.*)/) {
|
||||
my ($name)=($1);
|
||||
#print "Uses $name in $file\n";
|
||||
$uses{$name} .= "$file, ";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user