16#include "llvm/ADT/ImmutableMap.h"
24 const StackFrame *CallSite;
28 CountKey(
const StackFrame *CS,
unsigned ID) : CallSite(CS), BlockID(
ID) {}
31 return (CallSite == RHS.CallSite) && (BlockID == RHS.BlockID);
34 bool operator<(
const CountKey &RHS)
const {
35 return std::tie(CallSite, BlockID) < std::tie(RHS.CallSite, RHS.BlockID);
38 void Profile(llvm::FoldingSetNodeID &ID)
const {
39 ID.AddPointer(CallSite);
40 ID.AddInteger(BlockID);
46typedef llvm::ImmutableMap<CountKey, unsigned>
CountMap;
49 return CountMap(
static_cast<CountMap::TreeTy*
>(D));
53 return *
static_cast<CountMap::Factory*
>(F);
57 unsigned BlockID)
const {
59 CountMap::data_type* T = M.lookup(CountKey(CallSite, BlockID));
64 F =
new CountMap::Factory(Alloc);
68 delete static_cast<CountMap::Factory*
>(F);
75 CountKey(CallSite, BlockID),
static CountMap GetMap(void *D)
llvm::ImmutableMap< CountKey, unsigned > CountMap
static CountMap::Factory & GetFactory(void *F)
It represents a stack frame of the call stack (based on CallEvent).
Factory(llvm::BumpPtrAllocator &Alloc)
BlockCounter IncrementCount(BlockCounter BC, const StackFrame *CallSite, unsigned BlockID)
BlockCounter GetEmptyCounter()
unsigned getNumVisited(const StackFrame *CallSite, unsigned BlockID) const
The JSON file list parser is used to communicate input to InstallAPI.
bool operator==(const CallGraphNode::CallRecord &LHS, const CallGraphNode::CallRecord &RHS)
bool operator<(DeclarationName LHS, DeclarationName RHS)
Ordering on two declaration names.