summaryrefslogtreecommitdiffstats
path: root/lldb/include/lldb/Symbol/ClangASTImporter.h
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/include/lldb/Symbol/ClangASTImporter.h')
-rw-r--r--lldb/include/lldb/Symbol/ClangASTImporter.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/lldb/include/lldb/Symbol/ClangASTImporter.h b/lldb/include/lldb/Symbol/ClangASTImporter.h
index 587237e90ca..15f5cc37d82 100644
--- a/lldb/include/lldb/Symbol/ClangASTImporter.h
+++ b/lldb/include/lldb/Symbol/ClangASTImporter.h
@@ -20,6 +20,68 @@
#include "lldb/Symbol/ClangNamespaceDecl.h"
namespace lldb_private {
+
+class ClangASTMetrics
+{
+public:
+ static void DumpCounters (lldb::LogSP 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 (lldb::LogSP log, Counters &counters);
+};
class ClangASTImporter
{
OpenPOWER on IntegriCloud