]> granicus.if.org Git - clang/commitdiff
[analyzer] Introduce statistics for the total number of visited basic blocks
authorGeorge Karpenkov <ekarpenkov@apple.com>
Fri, 9 Feb 2018 23:37:47 +0000 (23:37 +0000)
committerGeorge Karpenkov <ekarpenkov@apple.com>
Fri, 9 Feb 2018 23:37:47 +0000 (23:37 +0000)
Differential Revision: https://reviews.llvm.org/D43133

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324785 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp

index fccea9ee53bf5b959f55f3f7dbfd04c7fcb984aa..48b0e2dcbf29f0388dbf0def8a7c90ca90e183f3 100644 (file)
@@ -57,6 +57,8 @@ STATISTIC(NumFunctionsAnalyzed,
                       "with inlining turned on).");
 STATISTIC(NumBlocksInAnalyzedFunctions,
                       "The # of basic blocks in the analyzed functions.");
+STATISTIC(NumVisitedBlocksInAnalyzedFunctions,
+          "The # of visited basic blocks in the analyzed functions.");
 STATISTIC(PercentReachableBlocks, "The % of reachable basic blocks.");
 STATISTIC(MaxCFGSize, "The maximum number of basic blocks in a function.");
 
@@ -565,6 +567,8 @@ void AnalysisConsumer::HandleTranslationUnit(ASTContext &C) {
 
   // Count how many basic blocks we have not covered.
   NumBlocksInAnalyzedFunctions = FunctionSummaries.getTotalNumBasicBlocks();
+  NumVisitedBlocksInAnalyzedFunctions =
+      FunctionSummaries.getTotalNumVisitedBasicBlocks();
   if (NumBlocksInAnalyzedFunctions > 0)
     PercentReachableBlocks =
       (FunctionSummaries.getTotalNumVisitedBasicBlocks() * 100) /