aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2013-03-14 17:18:30 +0000
committerJordan Rose <jordan_rose@apple.com>2013-03-14 17:18:30 +0000
commit4a374f9a58a5b350ec2e4123b20c9884ed1f5f15 (patch)
tree319f7cc85772b62b94492a1665cd40e0cc30ad9e /tools
parent374516c8ec4f0fcf5a8b65ef9cf029f862d11096 (diff)
downloadclang-4a374f9a58a5b350ec2e4123b20c9884ed1f5f15.tar.gz
[analyzer] Fix scan-build's -stats mode.
We were failing to match the output line, which led to us collecting no stats at all, which led to a divide-by-zero error. Fixes PR15510. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rwxr-xr-xtools/scan-build/scan-build17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/scan-build/scan-build b/tools/scan-build/scan-build
index 4965dbdc7a..ff82e129d1 100755
--- a/tools/scan-build/scan-build
+++ b/tools/scan-build/scan-build
@@ -284,10 +284,11 @@ sub UpdateInFilePath {
sub AddStatLine {
my $Line = shift;
my $Stats = shift;
+ my $File = shift;
print $Line . "\n";
- my $Regex = qr/(.*?)\ :\ (.*?)\ ->\ Total\ CFGBlocks:\ (\d+)\ \|\ Unreachable
+ my $Regex = qr/(.*?)\ ->\ Total\ CFGBlocks:\ (\d+)\ \|\ Unreachable
\ CFGBlocks:\ (\d+)\ \|\ Exhausted\ Block:\ (yes|no)\ \|\ Empty\ WorkList:
\ (yes|no)/x;
@@ -297,12 +298,12 @@ sub AddStatLine {
# Create a hash of the interesting fields
my $Row = {
- Filename => $1,
- Function => $2,
- Total => $3,
- Unreachable => $4,
- Aborted => $5,
- Empty => $6
+ Filename => $File,
+ Function => $1,
+ Total => $2,
+ Unreachable => $3,
+ Aborted => $4,
+ Empty => $5
};
# Add them to the stats array
@@ -383,7 +384,7 @@ sub ScanFile {
# Don't add internal statistics to the bug reports
if ($BugCategory =~ /statistics/i) {
- AddStatLine($BugDescription, $Stats);
+ AddStatLine($BugDescription, $Stats, $BugFile);
return;
}