diff --git a/lldb/include/lldb/Symbol/ClangASTImporter.h b/lldb/include/lldb/Symbol/ClangASTImporter.h --- a/lldb/include/lldb/Symbol/ClangASTImporter.h +++ b/lldb/include/lldb/Symbol/ClangASTImporter.h @@ -30,57 +30,6 @@ namespace lldb_private { -class ClangASTMetrics { -public: - static void DumpCounters(Log *log); - static void ClearLocalCounters() { local_counters = {0, 0, 0, 0, 0, 0}; } - - static void RegisterVisibleQuery() { - ++global_counters.m_visible_query_count; - ++local_counters.m_visible_query_count; - } - - static void RegisterLexicalQuery() { - ++global_counters.m_lexical_query_count; - ++local_counters.m_lexical_query_count; - } - - static void RegisterLLDBImport() { - ++global_counters.m_lldb_import_count; - ++local_counters.m_lldb_import_count; - } - - static void RegisterClangImport() { - ++global_counters.m_clang_import_count; - ++local_counters.m_clang_import_count; - } - - static void RegisterDeclCompletion() { - ++global_counters.m_decls_completed_count; - ++local_counters.m_decls_completed_count; - } - - static void RegisterRecordLayout() { - ++global_counters.m_record_layout_count; - ++local_counters.m_record_layout_count; - } - -private: - struct Counters { - uint64_t m_visible_query_count; - uint64_t m_lexical_query_count; - uint64_t m_lldb_import_count; - uint64_t m_clang_import_count; - uint64_t m_decls_completed_count; - uint64_t m_record_layout_count; - }; - - static Counters global_counters; - static Counters local_counters; - - static void DumpCounters(Log *log, Counters &counters); -}; - class ClangASTImporter { public: struct LayoutInfo { diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp @@ -524,8 +524,6 @@ } else if (!m_ast_importer_sp) return; - ClangASTMetrics::RegisterLexicalQuery(); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); const Decl *context_decl = dyn_cast(decl_context); @@ -671,8 +669,6 @@ void ClangASTSource::FindExternalVisibleDecls(NameSearchContext &context) { assert(m_ast_context); - ClangASTMetrics::RegisterVisibleQuery(); - const ConstString name(context.m_decl_name.getAsString().c_str()); Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); @@ -1714,8 +1710,6 @@ FieldOffsetMap &field_offsets, BaseOffsetMap &base_offsets, BaseOffsetMap &virtual_base_offsets) { - ClangASTMetrics::RegisterRecordLayout(); - static unsigned int invocation_id = 0; unsigned int current_id = invocation_id++; @@ -2032,8 +2026,6 @@ if (src_ast == nullptr) return CompilerType(); - ClangASTMetrics::RegisterLLDBImport(); - SetImportInProgress(true); QualType copied_qual_type; diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp @@ -84,8 +84,6 @@ bool ClangExpressionDeclMap::WillParse(ExecutionContext &exe_ctx, Materializer *materializer) { - ClangASTMetrics::ClearLocalCounters(); - EnableParserVars(); m_parser_vars->m_exe_ctx = exe_ctx; @@ -127,11 +125,6 @@ } void ClangExpressionDeclMap::DidParse() { - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); - - if (log) - ClangASTMetrics::DumpCounters(log); - if (m_parser_vars) { for (size_t entity_index = 0, num_entities = m_found_entities.GetSize(); entity_index < num_entities; ++entity_index) { @@ -685,8 +678,6 @@ NameSearchContext &context) { assert(m_ast_context); - ClangASTMetrics::RegisterVisibleQuery(); - const ConstString name(context.m_decl_name.getAsString().c_str()); Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); diff --git a/lldb/source/Symbol/ClangASTImporter.cpp b/lldb/source/Symbol/ClangASTImporter.cpp --- a/lldb/source/Symbol/ClangASTImporter.cpp +++ b/lldb/source/Symbol/ClangASTImporter.cpp @@ -25,36 +25,6 @@ using namespace lldb_private; using namespace clang; -ClangASTMetrics::Counters ClangASTMetrics::global_counters = {0, 0, 0, 0, 0, 0}; -ClangASTMetrics::Counters ClangASTMetrics::local_counters = {0, 0, 0, 0, 0, 0}; - -void ClangASTMetrics::DumpCounters(Log *log, - ClangASTMetrics::Counters &counters) { - LLDB_LOGF(log, " Number of visible Decl queries by name : %" PRIu64, - counters.m_visible_query_count); - LLDB_LOGF(log, " Number of lexical Decl queries : %" PRIu64, - counters.m_lexical_query_count); - LLDB_LOGF(log, " Number of imports initiated by LLDB : %" PRIu64, - counters.m_lldb_import_count); - LLDB_LOGF(log, " Number of imports conducted by Clang : %" PRIu64, - counters.m_clang_import_count); - LLDB_LOGF(log, " Number of Decls completed : %" PRIu64, - counters.m_decls_completed_count); - LLDB_LOGF(log, " Number of records laid out : %" PRIu64, - counters.m_record_layout_count); -} - -void ClangASTMetrics::DumpCounters(Log *log) { - if (!log) - return; - - LLDB_LOGF(log, "== ClangASTMetrics output =="); - LLDB_LOGF(log, "-- Global metrics --"); - DumpCounters(log, global_counters); - LLDB_LOGF(log, "-- Local metrics --"); - DumpCounters(log, local_counters); -} - clang::QualType ClangASTImporter::CopyType(clang::ASTContext *dst_ast, clang::ASTContext *src_ast, clang::QualType type) { @@ -628,8 +598,6 @@ } bool ClangASTImporter::CompleteTagDecl(clang::TagDecl *decl) { - ClangASTMetrics::RegisterDeclCompletion(); - DeclOrigin decl_origin = GetDeclOrigin(decl); if (!decl_origin.Valid()) @@ -651,8 +619,6 @@ bool ClangASTImporter::CompleteTagDeclWithOrigin(clang::TagDecl *decl, clang::TagDecl *origin_decl) { - ClangASTMetrics::RegisterDeclCompletion(); - clang::ASTContext *origin_ast_ctx = &origin_decl->getASTContext(); if (!ClangASTContext::GetCompleteDecl(origin_ast_ctx, origin_decl)) @@ -675,8 +641,6 @@ bool ClangASTImporter::CompleteObjCInterfaceDecl( clang::ObjCInterfaceDecl *interface_decl) { - ClangASTMetrics::RegisterDeclCompletion(); - DeclOrigin decl_origin = GetDeclOrigin(interface_decl); if (!decl_origin.Valid()) @@ -1037,8 +1001,6 @@ void ClangASTImporter::ASTImporterDelegate::Imported(clang::Decl *from, clang::Decl *to) { - ClangASTMetrics::RegisterClangImport(); - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS)); // Some decls shouldn't be tracked here because they were not created by