[lldb] Move FindTypes scoped timer to SymbolFileDWARFDebugMap

This commit is contained in:
Dave Lee 2022-03-11 11:16:06 -08:00
parent a6eeffa106
commit 3ca91adef8
2 changed files with 4 additions and 14 deletions

View File

@ -1025,7 +1025,9 @@ void Module::FindTypes(
llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages, llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages,
llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
TypeMap &types) { TypeMap &types) {
LLDB_SCOPED_TIMER(); // If a scoped timer is needed, place it in a SymbolFile::FindTypes override.
// A timer here is too high volume for some cases, for example when calling
// FindTypes on each object file.
if (SymbolFile *symbols = GetSymbolFile()) if (SymbolFile *symbols = GetSymbolFile())
symbols->FindTypes(pattern, languages, searched_symbol_files, types); symbols->FindTypes(pattern, languages, searched_symbol_files, types);
} }

View File

@ -1184,25 +1184,13 @@ void SymbolFileDWARFDebugMap::FindTypes(
llvm::ArrayRef<CompilerContext> context, LanguageSet languages, llvm::ArrayRef<CompilerContext> context, LanguageSet languages,
llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
TypeMap &types) { TypeMap &types) {
LLDB_SCOPED_TIMER();
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool { ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
oso_dwarf->FindTypes(context, languages, searched_symbol_files, types); oso_dwarf->FindTypes(context, languages, searched_symbol_files, types);
return false; return false;
}); });
} }
//
// uint32_t
// SymbolFileDWARFDebugMap::FindTypes (const SymbolContext& sc, const
// RegularExpression& regex, bool append, uint32_t max_matches, Type::Encoding
// encoding, lldb::user_id_t udt_uid, TypeList& types)
//{
// SymbolFileDWARF *oso_dwarf = GetSymbolFile (sc);
// if (oso_dwarf)
// return oso_dwarf->FindTypes (sc, regex, append, max_matches, encoding,
// udt_uid, types);
// return 0;
//}
CompilerDeclContext SymbolFileDWARFDebugMap::FindNamespace( CompilerDeclContext SymbolFileDWARFDebugMap::FindNamespace(
lldb_private::ConstString name, lldb_private::ConstString name,
const CompilerDeclContext &parent_decl_ctx) { const CompilerDeclContext &parent_decl_ctx) {