diff options
author | Sean Callanan <scallanan@apple.com> | 2011-10-14 01:15:27 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2011-10-14 01:15:27 +0000 |
commit | 187de46132da36d69d49a1249729daaf1046ffc7 (patch) | |
tree | c247b9ed5fba5fa6ef81d76e5bc997fd9fe35f34 /lldb/source/Expression/ClangExpressionDeclMap.cpp | |
parent | d9444d455e7158df4d801bc9ab05b8ad70318678 (diff) | |
download | bcm5719-llvm-187de46132da36d69d49a1249729daaf1046ffc7.tar.gz bcm5719-llvm-187de46132da36d69d49a1249729daaf1046ffc7.zip |
Improved logging for FindExternalLexicalDecls to
make it easier to track down which members belong
to which structs (and which call to
FindExternalLexicalDecls is doing the reporting).
llvm-svn: 141930
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 570570c610f..fea9a2e8d88 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -2512,19 +2512,25 @@ ClangExpressionDeclMap::FindExternalLexicalDecls (const DeclContext *decl_contex ASTContext *ast_context = &context_decl->getASTContext(); + static unsigned int invocation_id = 0; + unsigned int current_id = invocation_id++; + if (log) { if (const NamedDecl *context_named_decl = dyn_cast<NamedDecl>(context_decl)) - log->Printf("FindExternalLexicalDecls in '%s' (a %s) with %s predicate", + log->Printf("FindExternalLexicalDecls[%u] in '%s' (a %s) with %s predicate", + current_id, context_named_decl->getNameAsString().c_str(), context_decl->getDeclKindName(), (predicate ? "non-null" : "null")); else if(context_decl) - log->Printf("FindExternalLexicalDecls in a %s with %s predicate", + log->Printf("FindExternalLexicalDecls[%u] in a %s with %s predicate", + current_id, context_decl->getDeclKindName(), (predicate ? "non-null" : "null")); else - log->Printf("FindExternalLexicalDecls in a NULL context with %s predicate", + log->Printf("FindExternalLexicalDecls[%u] in a NULL context with %s predicate", + current_id, (predicate ? "non-null" : "null")); } @@ -2575,7 +2581,11 @@ ClangExpressionDeclMap::FindExternalLexicalDecls (const DeclContext *decl_contex llvm::raw_string_ostream decl_print_stream(decl_print_string); decl->print(decl_print_stream); decl_print_stream.flush(); - log->Printf(" Adding lexical decl %s", decl_print_string.c_str()); + + if (const NamedDecl *context_named_decl = dyn_cast<NamedDecl>(context_decl)) + log->Printf(" [%d] Adding [to %s] lexical decl %s", current_id, context_named_decl->getNameAsString().c_str(), decl_print_string.c_str()); + else + log->Printf(" [%d] Adding lexical decl %s", current_id, decl_print_string.c_str()); } Decl *copied_decl = ast_importer->CopyDecl(original_ctx, decl); |