Mercurial > hg > CbC > CbC_xv6
changeset 388:bfcfba3860c3
...
author | anatofuz |
---|---|
date | Mon, 27 Jul 2020 19:32:09 +0900 |
parents | ba8f847f4769 |
children | 174e02ed3509 |
files | src/gearsTools/generate_stub.pl |
diffstat | 1 files changed, 5 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gearsTools/generate_stub.pl Mon Jul 27 19:18:53 2020 +0900 +++ b/src/gearsTools/generate_stub.pl Mon Jul 27 19:32:09 2020 +0900 @@ -642,7 +642,7 @@ my $next = $2; my @args = split(/,/, $3); my $v = 0; - if (findFromFilename2CodeGear($filename, $next)) { + if (exists $filename2localCodes{$filename}->{$next}) { print $fd $_; next; } for my $n ( @{$dataGearVar{$codeGearName}} ) { @@ -726,23 +726,16 @@ open my $fh, '<', $filename; while (my $line = <$fh>) { if ($line =~ /extern\s+_\_code\s+(\w+)\((.*)\)/) { - push(@{$filename2localCodes{$filename}},$1); + $filename2localCodes{$filename}->{$1} = 1; } elsif ($line =~ /^\s*_\_code\s+(\w+)\((.*)\)(.*)/) { - push(@{$filename2localCodes{$filename}},$1); + $filename2localCodes{$filename}->{$1} = 1; } elsif ($line =~ /^\s*_\_code *\(\s*\*\s*(\w+)\)\((.*)\)(.*)/) { - push(@{$filename2localCodes{$filename}},$1); + $filename2localCodes{$filename}->{$1} = 1; } elsif ($line =~ /^\_\_code (\w+)\((.*)\)(.*)/) { - push(@{$filename2localCodes{$filename}},$1); + $filename2localCodes{$filename}->{$1} = 1; } } close $fh; } -sub findFromFilename2CodeGear { - my ($filename, $cgname) = @_; - - my @result = grep { /^$cgname$/ } @{$filename2localCodes{$filename}}; - return @result; -} - # end