Enabled the namespace-specific search functionality,

which had previously been commented out while I tested
it.  It's not fully working yet, but it doesn't break
our testsuite and it's an important piece of
functionality.

Also added some logging to SymbolFileDWARF to help
diagnose entities that are found in a symbol file,
but do not reside in the expected namespace.

llvm-svn: 141894
This commit is contained in:
Sean Callanan 2011-10-13 21:50:33 +00:00
parent 7cdf948601
commit ebe6067a8c
2 changed files with 20 additions and 5 deletions

View File

@ -2070,10 +2070,10 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, co
i->second.GetNamespaceDecl()->getNameAsString().c_str(), i->second.GetNamespaceDecl()->getNameAsString().c_str(),
i->first->GetFileSpec().GetFilename().GetCString()); i->first->GetFileSpec().GetFilename().GetCString());
//FindExternalVisibleDecls(context, FindExternalVisibleDecls(context,
// i->first, i->first,
// i->second, i->second,
// name); name);
} }
} }
else if (!isa<TranslationUnitDecl>(context.m_decl_context)) else if (!isa<TranslationUnitDecl>(context.m_decl_context))

View File

@ -1983,6 +1983,8 @@ SymbolFileDWARF::DIEIsInNamespace (const ClangNamespaceDecl *namespace_decl,
if (namespace_decl == NULL) if (namespace_decl == NULL)
return true; return true;
LogSP log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
const DWARFDebugInfoEntry *decl_ctx_die = GetDeclContextDIEContainingDIE (cu, die); const DWARFDebugInfoEntry *decl_ctx_die = GetDeclContextDIEContainingDIE (cu, die);
if (decl_ctx_die) if (decl_ctx_die)
{ {
@ -1991,12 +1993,21 @@ SymbolFileDWARF::DIEIsInNamespace (const ClangNamespaceDecl *namespace_decl,
if (clang_namespace_decl) if (clang_namespace_decl)
{ {
if (decl_ctx_die->Tag() != DW_TAG_namespace) if (decl_ctx_die->Tag() != DW_TAG_namespace)
{
if (log)
log->Printf("Found a match, but its parent is not a namespace");
return false; return false;
}
DeclContextToDIEMap::iterator pos = m_decl_ctx_to_die.find(clang_namespace_decl); DeclContextToDIEMap::iterator pos = m_decl_ctx_to_die.find(clang_namespace_decl);
if (pos == m_decl_ctx_to_die.end()) if (pos == m_decl_ctx_to_die.end())
{
if (log)
log->Printf("Found a match in a namespace, but its parent is not the requested namespace");
return false; return false;
}
return decl_ctx_die == pos->second; return decl_ctx_die == pos->second;
} }
@ -2010,6 +2021,10 @@ SymbolFileDWARF::DIEIsInNamespace (const ClangNamespaceDecl *namespace_decl,
return true; return true;
} }
} }
if (log)
log->Printf("Found a match, but its parent doesn't exist");
return false; return false;
} }
uint32_t uint32_t