2018-02-28 09:10:04 +08:00
|
|
|
//===- FunctionSummary.cpp - Stores summaries of functions. ---------------===//
|
2012-04-03 10:05:47 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2012-04-03 10:05:47 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2013-04-02 08:26:26 +08:00
|
|
|
// This file defines a summary of a function gathered/used by static analysis.
|
2012-04-03 10:05:47 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h"
|
2018-02-28 09:10:04 +08:00
|
|
|
|
2012-04-03 10:05:47 +08:00
|
|
|
using namespace clang;
|
|
|
|
using namespace ento;
|
|
|
|
|
|
|
|
unsigned FunctionSummariesTy::getTotalNumBasicBlocks() {
|
|
|
|
unsigned Total = 0;
|
2018-02-28 09:10:04 +08:00
|
|
|
for (const auto &I : Map)
|
|
|
|
Total += I.second.TotalBasicBlocks;
|
2012-04-03 10:05:47 +08:00
|
|
|
return Total;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned FunctionSummariesTy::getTotalNumVisitedBasicBlocks() {
|
|
|
|
unsigned Total = 0;
|
2018-02-28 09:10:04 +08:00
|
|
|
for (const auto &I : Map)
|
|
|
|
Total += I.second.VisitedBasicBlocks.count();
|
2012-04-03 10:05:47 +08:00
|
|
|
return Total;
|
|
|
|
}
|