[Lldb-commits] [PATCH] D143398: [lldb][DWARFASTParserClang] Correctly resolve imported namespaces during expression evaluation

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 6 16:10:04 PST 2023


aprantl added a comment.

SGTM.



================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:3480
+  clang::NamespaceDecl *namespace_decl =
+      static_cast<clang::NamespaceDecl *>(m_die_to_decl_ctx[die.GetDIE()]);
+  if (namespace_decl)
----------------
The common pattern in LLVM (and thinking of it, I'm surprised we don't have some kind of helper template for it) is to use find() since operator[] inserts a default-constructed element into the list, which will screw with anyone who concurrently searches using find().


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143398/new/

https://reviews.llvm.org/D143398



More information about the lldb-commits mailing list