From: George Karpenkov Date: Fri, 9 Feb 2018 23:37:47 +0000 (+0000) Subject: [analyzer] Introduce statistics for the total number of visited basic blocks X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1774e274acf780c3ca203e40f8968f5fee1682c2;p=clang [analyzer] Introduce statistics for the total number of visited basic blocks Differential Revision: https://reviews.llvm.org/D43133 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324785 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp index fccea9ee53..48b0e2dcbf 100644 --- a/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp +++ b/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp @@ -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) /