From aa04ce761793bfff6de398091125823476a6e924 Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Wed, 20 May 2020 15:02:16 +0200 Subject: [PATCH] [lldb][NFC] Minor NamespaceMap refactor --- lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h | 4 ++-- .../Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h index 8cdc1a8..ed32eac 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangASTImporter.h @@ -102,8 +102,8 @@ public: // Namespace maps // - typedef std::vector> - NamespaceMap; + typedef std::pair NamespaceMapItem; + typedef std::vector NamespaceMap; typedef std::shared_ptr NamespaceMapSP; void RegisterNamespaceMap(const clang::NamespaceDecl *decl, diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp index 7d66cc0..7d40cd0 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp @@ -676,13 +676,11 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls( LLDB_LOGV(log, " CEDM::FEVD Inspecting (NamespaceMap*){0:x} ({1} entries)", namespace_map.get(), namespace_map->size()); - for (ClangASTImporter::NamespaceMap::iterator i = namespace_map->begin(), - e = namespace_map->end(); - i != e; ++i) { + for (ClangASTImporter::NamespaceMapItem &n : *namespace_map) { LLDB_LOG(log, " CEDM::FEVD Searching namespace {0} in module {1}", - i->second.GetName(), i->first->GetFileSpec().GetFilename()); + n.second.GetName(), n.first->GetFileSpec().GetFilename()); - FindExternalVisibleDecls(context, i->first, i->second); + FindExternalVisibleDecls(context, n.first, n.second); } } else if (isa(context.m_decl_context)) { CompilerDeclContext namespace_decl; -- 2.7.4