comparison src/gearsTools/lib/Gears/Context.pm @ 131:c690327cabc8

using dg file
author anatofuz
date Wed, 04 Dec 2019 20:44:29 +0900
parents e45b8d57b9e8
children ae25a4e76377
comparison
equal deleted inserted replaced
130:3312d7ce91e6 131:c690327cabc8
28 my $self = shift; 28 my $self = shift;
29 my %counter; 29 my %counter;
30 for my $cbc_file (@{$self->{compile_sources}}) { 30 for my $cbc_file (@{$self->{compile_sources}}) {
31 open my $fh , '<', $cbc_file; 31 open my $fh , '<', $cbc_file;
32 while (my $line = <$fh>) { 32 while (my $line = <$fh>) {
33 if ($line =~ /#interface\s*"(.*)\.h"/ || $line =~ /^\/\/\s*use\s*"(.*)\.h"/) { 33 if ($line =~ /#interface\s*"(.*)\.h"/ || $line =~ /^\/\/\s*data_gear\s*"(.*)\.(?:h|dg)?"/) {
34 $self->{data_gears_with_count}->{$1}->{caller}->{$cbc_file}++; 34 $self->{data_gears_with_count}->{$1}->{caller}->{$cbc_file}++;
35 $counter{interfaces}->{$1}++; 35 $counter{interfaces}->{$1}++;
36 next; 36 next;
37 } 37 }
38 38
205 my %res; 205 my %res;
206 map { $res{$_}++ } @$targets; 206 map { $res{$_}++ } @$targets;
207 207
208 my $header_paths = Gears::Util->find_headers_path($search_bash_path); 208 my $header_paths = Gears::Util->find_headers_path($search_bash_path);
209 map { 209 map {
210 if (/(\w+)\.h/) { 210 if (/(\w+)\.(?:h|dg)/) {
211 my $header_file = $1; 211 my $header_file = $1;
212 if (exists $res{$header_file}) { 212 if (exists $res{$header_file}) {
213 if ($res{$header_file} =~ /^\d+$/){ 213 if ($res{$header_file} =~ /^\d+$/){
214 $res{$header_file} = $_; 214 $res{$header_file} = $_;
215 } elsif (($_ =~ /\.dg$/) && ($res{$header_file} =~ /\.h$/)) { 215 } elsif (($_ =~ /\.dg$/) && ($res{$header_file} =~ /\.h$/)) {