Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(93)

Issue 4631089: Add analysis stats to compile (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 5 months ago by chandlerc
Modified:
13 years, 5 months ago
Reviewers:
Visibility:
Public.

Description

Build up statistics about the work done for analysis based warnings. Special detail is added for uninitialized variable analysis as this has serious performance problems than need to be tracked. Computing some of this data is expensive, for example walking the CFG to determine its size. To avoid doing that unless the stats data is going to be used, we thread a bit into the Sema object to track whether detailed stats should be collected or not. This bit is used to avoid computations whereever the computations are likely to be more expensive than checking the state of the flag. Thus, counters are in some cases unconditionally updated, but the more expensive (and less frequent) aggregation steps are skipped. With this patch, we're able to see that for for the reduced testcase in PR10183: *** Analysis Based Warnings Stats: 98 functions analyzed (0 w/o CFGs). 8526 CFG blocks built. 87 average CFG blocks per function. 7277 max CFG blocks per function. 68 functions analyzed for uninitialiazed variables 1359 variables analyzed. 19 average variables per function. 1196 max variables per function. 2540494 block visits. 37360 average block visits per function. 2536495 max block visits per function. That last number is the somewhat scary one that indicates the problem in PR10183.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+152 lines, -17 lines) Patch
M include/clang/Analysis/Analyses/UninitializedValues.h View 1 chunk +8 lines, -2 lines 0 comments Download
M include/clang/Analysis/AnalysisContext.h View 1 chunk +5 lines, -0 lines 0 comments Download
M include/clang/Sema/AnalysisBasedWarnings.h View 2 chunks +37 lines, -0 lines 0 comments Download
M include/clang/Sema/Sema.h View 3 chunks +6 lines, -3 lines 0 comments Download
M lib/Analysis/UninitializedValues.cpp View 3 chunks +13 lines, -7 lines 0 comments Download
M lib/Parse/ParseAST.cpp View 2 chunks +6 lines, -1 line 0 comments Download
M lib/Sema/AnalysisBasedWarnings.cpp View 2 chunks +66 lines, -2 lines 0 comments Download
M lib/Sema/Sema.cpp View 2 chunks +11 lines, -2 lines 0 comments Download

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b