17 #include "llvm/ADT/ImmutableMap.h"
19 using namespace clang;
30 : CallSite(CS), BlockID(ID) {}
33 return (CallSite == RHS.CallSite) && (BlockID == RHS.BlockID);
36 bool operator<(
const CountKey &RHS)
const {
37 return std::tie(CallSite, BlockID) < std::tie(RHS.CallSite, RHS.BlockID);
40 void Profile(llvm::FoldingSetNodeID &
ID)
const {
41 ID.AddPointer(CallSite);
42 ID.AddInteger(BlockID);
51 return CountMap(static_cast<CountMap::TreeTy*>(D));
55 return *
static_cast<CountMap::Factory*
>(F);
59 unsigned BlockID)
const {
61 CountMap::data_type* T = M.lookup(CountKey(CallSite, BlockID));
66 F =
new CountMap::Factory(Alloc);
70 delete static_cast<CountMap::Factory*
>(F);
78 CountKey(CallSite, BlockID),
bool operator==(CanQual< T > x, CanQual< U > y)
An abstract data type used to count the number of times a given block has been visited along a path a...
Factory(llvm::BumpPtrAllocator &Alloc)
llvm::ImmutableMap< CountKey, unsigned > CountMap
static CountMap GetMap(void *D)
static CountMap::Factory & GetFactory(void *F)
static DeltaTreeNode * getRoot(void *Root)
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
bool operator<(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.
BlockCounter GetEmptyCounter()
unsigned getNumVisited(const StackFrameContext *CallSite, unsigned BlockID) const
BlockCounter IncrementCount(BlockCounter BC, const StackFrameContext *CallSite, unsigned BlockID)