2013-04-02 08:26:26 +08:00
|
|
|
//== FunctionSummary.cpp - Stores summaries of functions. ----------*- C++ -*-//
|
2012-04-03 10:05:47 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
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"
|
|
|
|
using namespace clang;
|
|
|
|
using namespace ento;
|
|
|
|
|
|
|
|
unsigned FunctionSummariesTy::getTotalNumBasicBlocks() {
|
|
|
|
unsigned Total = 0;
|
|
|
|
for (MapTy::iterator I = Map.begin(), E = Map.end(); I != E; ++I) {
|
2013-04-02 08:26:26 +08:00
|
|
|
Total += I->second.TotalBasicBlocks;
|
2012-04-03 10:05:47 +08:00
|
|
|
}
|
|
|
|
return Total;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned FunctionSummariesTy::getTotalNumVisitedBasicBlocks() {
|
|
|
|
unsigned Total = 0;
|
|
|
|
for (MapTy::iterator I = Map.begin(), E = Map.end(); I != E; ++I) {
|
2013-04-02 08:26:26 +08:00
|
|
|
Total += I->second.VisitedBasicBlocks.count();
|
2012-04-03 10:05:47 +08:00
|
|
|
}
|
|
|
|
return Total;
|
|
|
|
}
|