1*0b57cec5SDimitry Andric //===- FunctionSummary.cpp - Stores summaries of functions. ---------------===// 2*0b57cec5SDimitry Andric // 3*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*0b57cec5SDimitry Andric // 7*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 8*0b57cec5SDimitry Andric // 9*0b57cec5SDimitry Andric // This file defines a summary of a function gathered/used by static analysis. 10*0b57cec5SDimitry Andric // 11*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 12*0b57cec5SDimitry Andric 13*0b57cec5SDimitry Andric #include "clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h" 14*0b57cec5SDimitry Andric 15*0b57cec5SDimitry Andric using namespace clang; 16*0b57cec5SDimitry Andric using namespace ento; 17*0b57cec5SDimitry Andric getTotalNumBasicBlocks()18*0b57cec5SDimitry Andricunsigned FunctionSummariesTy::getTotalNumBasicBlocks() { 19*0b57cec5SDimitry Andric unsigned Total = 0; 20*0b57cec5SDimitry Andric for (const auto &I : Map) 21*0b57cec5SDimitry Andric Total += I.second.TotalBasicBlocks; 22*0b57cec5SDimitry Andric return Total; 23*0b57cec5SDimitry Andric } 24*0b57cec5SDimitry Andric getTotalNumVisitedBasicBlocks()25*0b57cec5SDimitry Andricunsigned FunctionSummariesTy::getTotalNumVisitedBasicBlocks() { 26*0b57cec5SDimitry Andric unsigned Total = 0; 27*0b57cec5SDimitry Andric for (const auto &I : Map) 28*0b57cec5SDimitry Andric Total += I.second.VisitedBasicBlocks.count(); 29*0b57cec5SDimitry Andric return Total; 30*0b57cec5SDimitry Andric } 31