Refactor FoldingSet profiling code for LocationContexts, and add a new BlockInvocationContext to represent the invocation of a block.
llvm-svn: 90506
This commit is contained in:
@@ -80,6 +80,10 @@ AnalysisContext *AnalysisContextManager::getContext(const Decl *D) {
|
||||
return AC;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// FoldingSet profiling.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void LocationContext::Profile(llvm::FoldingSetNodeID &ID, ContextKind k,
|
||||
AnalysisContext *ctx,
|
||||
const LocationContext *parent) {
|
||||
@@ -88,18 +92,31 @@ void LocationContext::Profile(llvm::FoldingSetNodeID &ID, ContextKind k,
|
||||
ID.AddPointer(parent);
|
||||
}
|
||||
|
||||
void StackFrameContext::Profile(llvm::FoldingSetNodeID &ID,AnalysisContext *ctx,
|
||||
const LocationContext *parent, const Stmt *s) {
|
||||
LocationContext::Profile(ID, StackFrame, ctx, parent);
|
||||
ID.AddPointer(s);
|
||||
void LocationContext::ProfileCommon(llvm::FoldingSetNodeID &ID,
|
||||
ContextKind ck,
|
||||
AnalysisContext *ctx,
|
||||
const LocationContext *parent,
|
||||
const void* data) {
|
||||
LocationContext::Profile(ID, ck, ctx, parent);
|
||||
ID.AddPointer(data);
|
||||
}
|
||||
|
||||
void ScopeContext::Profile(llvm::FoldingSetNodeID &ID, AnalysisContext *ctx,
|
||||
const LocationContext *parent, const Stmt *s) {
|
||||
LocationContext::Profile(ID, Scope, ctx, parent);
|
||||
ID.AddPointer(s);
|
||||
void StackFrameContext::Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, getAnalysisContext(), getParent(), CallSite);
|
||||
}
|
||||
|
||||
void ScopeContext::Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, getAnalysisContext(), getParent(), Enter);
|
||||
}
|
||||
|
||||
void BlockInvocationContext::Profile(llvm::FoldingSetNodeID &ID) {
|
||||
Profile(ID, getAnalysisContext(), getParent(), BD);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Cleanup.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
LocationContextManager::~LocationContextManager() {
|
||||
clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user