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

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 7 04:19:26 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())
----------------
labath wrote:

In the first version of the patch I had an `IsAnonymousNamespace` and `MatchesAnonymousNamespace` (the difference being in how they test the `kind` bits) . This was before I changed everything to use an empty string, after which it did not seem that useful...

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


More information about the lldb-commits mailing list