10b57cec5SDimitry Andric //===- FunctionSummary.cpp - Stores summaries of functions. ---------------===// 20b57cec5SDimitry Andric // 30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric // 70b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric // 90b57cec5SDimitry Andric // This file defines a summary of a function gathered/used by static analysis. 100b57cec5SDimitry Andric // 110b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 120b57cec5SDimitry Andric 130b57cec5SDimitry Andric #include "clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h" 140b57cec5SDimitry Andric 150b57cec5SDimitry Andric using namespace clang; 160b57cec5SDimitry Andric using namespace ento; 170b57cec5SDimitry Andric getTotalNumBasicBlocks()180b57cec5SDimitry Andricunsigned FunctionSummariesTy::getTotalNumBasicBlocks() { 190b57cec5SDimitry Andric unsigned Total = 0; 200b57cec5SDimitry Andric for (const auto &I : Map) 210b57cec5SDimitry Andric Total += I.second.TotalBasicBlocks; 220b57cec5SDimitry Andric return Total; 230b57cec5SDimitry Andric } 240b57cec5SDimitry Andric getTotalNumVisitedBasicBlocks()250b57cec5SDimitry Andricunsigned FunctionSummariesTy::getTotalNumVisitedBasicBlocks() { 260b57cec5SDimitry Andric unsigned Total = 0; 270b57cec5SDimitry Andric for (const auto &I : Map) 280b57cec5SDimitry Andric Total += I.second.VisitedBasicBlocks.count(); 290b57cec5SDimitry Andric return Total; 300b57cec5SDimitry Andric } 31