@@ -556,26 +556,8 @@ void ClangASTSource::FindExternalVisibleDecls(NameSearchContext &context) {
556556
557557 context.m_namespace_map = std::make_shared<ClangASTImporter::NamespaceMap>();
558558
559- if (const NamespaceDecl *namespace_context =
560- dyn_cast<NamespaceDecl>(context.m_decl_context )) {
561- ClangASTImporter::NamespaceMapSP namespace_map =
562- m_ast_importer_sp->GetNamespaceMap (namespace_context);
563-
564- if (log && log->GetVerbose ())
565- LLDB_LOG (log, " CAS::FEVD Inspecting namespace map {1} ({2} entries)" ,
566- namespace_map.get (), namespace_map->size ());
567-
568- if (!namespace_map)
569- return ;
570-
571- for (ClangASTImporter::NamespaceMap::iterator i = namespace_map->begin (),
572- e = namespace_map->end ();
573- i != e; ++i) {
574- LLDB_LOG (log, " CAS::FEVD Searching namespace {1} in module {2}" ,
575- i->second .GetName (), i->first ->GetFileSpec ().GetFilename ());
576-
577- FindExternalVisibleDecls (context, i->first , i->second );
578- }
559+ if (isa<NamespaceDecl>(context.m_decl_context )) {
560+ LookupInNamespace (context);
579561 } else if (isa<ObjCInterfaceDecl>(context.m_decl_context )) {
580562 FindObjCPropertyAndIvarDecls (context);
581563 } else if (!isa<TranslationUnitDecl>(context.m_decl_context )) {
@@ -1417,6 +1399,32 @@ void ClangASTSource::FindObjCPropertyAndIvarDecls(NameSearchContext &context) {
14171399 } while (false );
14181400}
14191401
1402+ void ClangASTSource::LookupInNamespace (NameSearchContext &context) {
1403+ const NamespaceDecl *namespace_context =
1404+ dyn_cast<NamespaceDecl>(context.m_decl_context );
1405+
1406+ Log *log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
1407+
1408+ ClangASTImporter::NamespaceMapSP namespace_map =
1409+ m_ast_importer_sp->GetNamespaceMap (namespace_context);
1410+
1411+ if (log && log->GetVerbose ())
1412+ LLDB_LOG (log, " CAS::FEVD Inspecting namespace map {1} ({2} entries)" ,
1413+ namespace_map.get (), namespace_map->size ());
1414+
1415+ if (!namespace_map)
1416+ return ;
1417+
1418+ for (ClangASTImporter::NamespaceMap::iterator i = namespace_map->begin (),
1419+ e = namespace_map->end ();
1420+ i != e; ++i) {
1421+ LLDB_LOG (log, " CAS::FEVD Searching namespace {1} in module {2}" ,
1422+ i->second .GetName (), i->first ->GetFileSpec ().GetFilename ());
1423+
1424+ FindExternalVisibleDecls (context, i->first , i->second );
1425+ }
1426+ }
1427+
14201428typedef llvm::DenseMap<const FieldDecl *, uint64_t > FieldOffsetMap;
14211429typedef llvm::DenseMap<const CXXRecordDecl *, CharUnits> BaseOffsetMap;
14221430
0 commit comments