From: Ted Kremenek Date: Mon, 25 Aug 2008 20:45:07 +0000 (+0000) Subject: Use path information from .info files when computing common prefix information. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d52e4252264f9d1f62da0b5b89d099cd7dd7fa2f;p=clang 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 --- 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 = ; + 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 "$problem$srcfileView\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}) {