diff options
author | Anna Zaks <ganna@apple.com> | 2012-04-03 02:05:47 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-04-03 02:05:47 +0000 |
commit | e62f048960645b79363408fdead53fec2a063c52 (patch) | |
tree | 9010101e69af556f2371b82cf4c346f39a23dfdc /lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | |
parent | 0ea6164a7ff685f64ddfe3ec983a2b052ea91afb (diff) |
[analyzer] Record the basic blocks covered by the analyzes run.
Store this info inside the function summary generated for all analyzed
functions. This is useful for coverage stats and can be helpful for
analyzer state space search strategies.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153923 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index 3b9deda2ba..df2d265cad 100644 --- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -53,6 +53,9 @@ static ExplodedNode::Auditor* CreateUbiViz(); STATISTIC(NumFunctionTopLevel, "The # of functions at top level."); STATISTIC(NumFunctionsAnalyzed, "The # of functions analysed (as top level)."); +STATISTIC(NumBlocksInAnalyzedFunctions, + "The # of basic blocks in the analyzed functions."); +STATISTIC(PercentReachableBlocks, "The % of reachable basic blocks."); //===----------------------------------------------------------------------===// // Special PathDiagnosticConsumers. @@ -122,6 +125,13 @@ public: } ~AnalysisConsumer() { + // Count how many basic blocks we have not covered. + NumBlocksInAnalyzedFunctions = FunctionSummaries.getTotalNumBasicBlocks(); + if (NumBlocksInAnalyzedFunctions > 0) + PercentReachableBlocks = + (FunctionSummaries.getTotalNumVisitedBasicBlocks() * 100) / + NumBlocksInAnalyzedFunctions; + if (Opts.PrintStats) delete TUTotalTimer; } |