mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-08 14:06:07 +00:00

The summaries lasted for the lifetime of the map anyway; no reason to include an extra allocation. Also, use SmallBitVector instead of BitVector to track the visited basic blocks -- most functions will have less than 64 basic blocks -- and use bitfields for the other fields to reduce the size of the structure. No functionality change. llvm-svn: 178514
33 lines
1.0 KiB
C++
33 lines
1.0 KiB
C++
//== FunctionSummary.cpp - Stores summaries of functions. ----------*- C++ -*-//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file defines a summary of a function gathered/used by static analysis.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#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) {
|
|
Total += I->second.TotalBasicBlocks;
|
|
}
|
|
return Total;
|
|
}
|
|
|
|
unsigned FunctionSummariesTy::getTotalNumVisitedBasicBlocks() {
|
|
unsigned Total = 0;
|
|
for (MapTy::iterator I = Map.begin(), E = Map.end(); I != E; ++I) {
|
|
Total += I->second.VisitedBasicBlocks.count();
|
|
}
|
|
return Total;
|
|
}
|