summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2013-03-08 20:04:57 +0000
committerSean Callanan <scallanan@apple.com>2013-03-08 20:04:57 +0000
commit8106d8082c406b4c381cd0d9604835fc35b45990 (patch)
tree6f30c6ad513b7cf77d6665b4cee0d397e3e65238 /lldb/source/Expression
parentcadde909838380054e5cc88c65c976723e247abd (diff)
downloadbcm5719-llvm-8106d8082c406b4c381cd0d9604835fc35b45990.tar.gz
bcm5719-llvm-8106d8082c406b4c381cd0d9604835fc35b45990.zip
Added very lightweight, statically-allocated
counters for a variety of metrics associated with expression parsing. This should give some idea of how much work the expression parser is doing on Clang's behalf, and help with hopefully reducing that load over time. <rdar://problem/13210748> Audit type search/import for expressions llvm-svn: 176714
Diffstat (limited to 'lldb/source/Expression')
-rw-r--r--lldb/source/Expression/ClangASTSource.cpp12
-rw-r--r--lldb/source/Expression/ClangExpressionDeclMap.cpp11
2 files changed, 20 insertions, 3 deletions
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp
index 266dce84464..c394a8cb6f0 100644
--- a/lldb/source/Expression/ClangASTSource.cpp
+++ b/lldb/source/Expression/ClangASTSource.cpp
@@ -367,7 +367,9 @@ clang::ExternalLoadResult
ClangASTSource::FindExternalLexicalDecls (const DeclContext *decl_context,
bool (*predicate)(Decl::Kind),
llvm::SmallVectorImpl<Decl*> &decls)
-{
+{
+ ClangASTMetrics::RegisterLexicalQuery();
+
lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
const Decl *context_decl = dyn_cast<Decl>(decl_context);
@@ -485,6 +487,8 @@ ClangASTSource::FindExternalVisibleDecls (NameSearchContext &context)
{
assert (m_ast_context);
+ ClangASTMetrics::RegisterVisibleQuery();
+
const ConstString name(context.m_decl_name.getAsString().c_str());
lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
@@ -1435,6 +1439,8 @@ ClangASTSource::layoutRecordType(const RecordDecl *record,
BaseOffsetMap &base_offsets,
BaseOffsetMap &virtual_base_offsets)
{
+ ClangASTMetrics::RegisterRecordLayout();
+
static unsigned int invocation_id = 0;
unsigned int current_id = invocation_id++;
@@ -1677,7 +1683,9 @@ void *
ClangASTSource::GuardedCopyType (ASTContext *dest_context,
ASTContext *source_context,
void *clang_type)
-{
+{
+ ClangASTMetrics::RegisterLLDBImport();
+
SetImportInProgress(true);
QualType ret_qual_type = m_ast_importer->CopyType (m_ast_context, source_context, QualType::getFromOpaquePtr(clang_type));
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp
index 1b621224be6..078825797dc 100644
--- a/lldb/source/Expression/ClangExpressionDeclMap.cpp
+++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp
@@ -75,7 +75,9 @@ ClangExpressionDeclMap::~ClangExpressionDeclMap()
bool
ClangExpressionDeclMap::WillParse(ExecutionContext &exe_ctx)
-{
+{
+ ClangASTMetrics::ClearLocalCounters();
+
EnableParserVars();
m_parser_vars->m_exe_ctx = exe_ctx;
@@ -111,6 +113,11 @@ ClangExpressionDeclMap::WillParse(ExecutionContext &exe_ctx)
void
ClangExpressionDeclMap::DidParse()
{
+ lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
+
+ if (log)
+ ClangASTMetrics::DumpCounters(log);
+
if (m_parser_vars.get())
{
for (size_t entity_index = 0, num_entities = m_found_entities.GetSize();
@@ -2605,6 +2612,8 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context)
{
assert (m_ast_context);
+ ClangASTMetrics::RegisterVisibleQuery();
+
const ConstString name(context.m_decl_name.getAsString().c_str());
lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
OpenPOWER on IntegriCloud