]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/FunctionSummary.cpp
Merge clang 7.0.1 and several follow-up changes
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / clang / lib / StaticAnalyzer / Core / FunctionSummary.cpp
1 //===- FunctionSummary.cpp - Stores summaries of functions. ---------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines a summary of a function gathered/used by static analysis.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h"
15
16 using namespace clang;
17 using namespace ento;
18
19 unsigned FunctionSummariesTy::getTotalNumBasicBlocks() {
20   unsigned Total = 0;
21   for (const auto &I : Map)
22     Total += I.second.TotalBasicBlocks;
23   return Total;
24 }
25
26 unsigned FunctionSummariesTy::getTotalNumVisitedBasicBlocks() {
27   unsigned Total = 0;
28   for (const auto &I : Map)
29     Total += I.second.VisitedBasicBlocks.count();
30   return Total;
31 }