diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-08-25 20:45:07 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-08-25 20:45:07 +0000 |
commit | d52e4252264f9d1f62da0b5b89d099cd7dd7fa2f (patch) | |
tree | eebc34fc79f97939dedfbe047653dd258473afd9 | |
parent | 2ec5cd553542ec54652fb2ae2395e46795b1af84 (diff) |
Use path information from .info files when computing common prefix information.
This partially implements PR 2705: http://llvm.org/bugs/show_bug.cgi?id=2705
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55327 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-x | utils/scan-build | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/utils/scan-build b/utils/scan-build index 90824ab967..88728bdf6f 100755 --- a/utils/scan-build +++ b/utils/scan-build @@ -409,6 +409,20 @@ sub Postprocess { my @Index; foreach my $file (@files) { ScanFile(\@Index, $Dir, $file); } + # Scan the crashes directory and use the information in the .info files + # to update the common prefix directory. + if (-d "$Dir/crashes") { + opendir(DIR, "$Dir/crashes"); + my @files = grep { /[.]info$/; } readdir(DIR); + closedir(DIR); + foreach my $file (@files) { + open IN, "$Dir/crashes/$file" or DieDiag("cannot open $file\n"); + my $Path = <IN>; + if (defined $Path) { UpdatePrefix($Path); } + close IN; + } + } + # Generate an index.html file. my $FName = "$Dir/index.html"; open(OUT, ">", $FName) or DieDiag("Cannot create file '$FName'\n"); @@ -588,6 +602,8 @@ ENDTEXT chomp $problem; close (INFO); # Print the information in the table. + my $prefix = GetPrefix(); + if (defined $prefix) { $srcfile =~ s/^$prefix//; } print OUT "<tr><td>$problem</td><td>$srcfile</td><td class=\"View\"><a href=\"crashes/$ppfile\">View</a></td></tr>\n"; } @@ -729,9 +745,10 @@ OPTIONS: -V - View analysis results in a web browser when the build --view completes. -ENDTEXT - print " Available Source Code Analyses (multiple analyses may be specified):\n\n"; + Available Source Code Analyses (multiple analyses may be specified): + +ENDTEXT foreach my $Analysis (sort keys %AvailableAnalyses) { if (defined $AnalysesDefaultEnabled{$Analysis}) { |