[Lldb-commits] [lldb] [lldb] Better matching of types in anonymous namespaces (PR #102111)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 6 04:34:14 PDT 2024


================
@@ -145,10 +159,16 @@ bool TypeQuery::ContextMatches(
     ++pat;
   }
 
-  // Skip over any remaining module entries if we were asked to do that.
-  while (GetIgnoreModules() && ctx != ctx_end &&
-         ctx->kind == CompilerContextKind::Module)
-    ++ctx;
+  // Skip over any remaining module and anonymous namespace entries if we were
+  // asked to do that.
+  auto should_skip = [this](const CompilerContext &ctx) {
+    if (ctx.kind == CompilerContextKind::Module)
+      return GetIgnoreModules();
+    if (ctx.kind == CompilerContextKind::Namespace && ctx.name.IsEmpty())
----------------
Michael137 wrote:

Almost wonder if this check should be a `IsAnonymousNamespace` helper function on `CompilerContext`. But maybe that'd make it too C++-specific? Since it's just in this function, feel free to ignore

https://github.com/llvm/llvm-project/pull/102111


More information about the lldb-commits mailing list