mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: Add some counters related to name lookup
This commit is contained in:
@@ -454,6 +454,12 @@ static bool isParsedModule(const ModuleDecl *mod) {
|
||||
void ModuleDecl::lookupValue(AccessPathTy AccessPath, DeclName Name,
|
||||
NLKind LookupKind,
|
||||
SmallVectorImpl<ValueDecl*> &Result) const {
|
||||
auto *stats = getASTContext().Stats;
|
||||
if (stats)
|
||||
stats->getFrontendCounters().NumModuleLookupValue++;
|
||||
|
||||
FrontendStatsTracer tracer(stats, "module-lookup-value");
|
||||
|
||||
if (isParsedModule(this)) {
|
||||
FrontendStatsTracer tracer(getASTContext().Stats, "source-file-lookup-value");
|
||||
getSourceLookupCache().lookupValue(AccessPath, Name, LookupKind, Result);
|
||||
@@ -604,6 +610,10 @@ void SourceFile::lookupClassMembers(ModuleDecl::AccessPathTy accessPath,
|
||||
void ModuleDecl::lookupClassMember(AccessPathTy accessPath,
|
||||
DeclName name,
|
||||
SmallVectorImpl<ValueDecl*> &results) const {
|
||||
auto *stats = getASTContext().Stats;
|
||||
if (stats)
|
||||
stats->getFrontendCounters().NumModuleLookupClassMember++;
|
||||
|
||||
if (isParsedModule(this)) {
|
||||
FrontendStatsTracer tracer(getASTContext().Stats, "source-file-lookup-class-member");
|
||||
auto &cache = getSourceLookupCache();
|
||||
|
||||
Reference in New Issue
Block a user