================
@@ -134,7 +134,9 @@ bool TypeQuery::ContextMatches(
     if (ctx == ctx_end)
       return false; // Pattern too long.
 
-    if (ctx->kind == CompilerContextKind::Namespace && ctx->name.IsEmpty()) {
+    if ((ctx->kind & CompilerContextKind::Namespace) ==
----------------
Nerixyz wrote:

That's a good point. I'll create the context in the PDB plugin. To avoid 
materializing all types that match the basename, I can see two approaches:

1. Naively use the type's name (PDB stores the demangled name there). This 
would essentially do the same as the `TypeQuery` constructor where it tries to 
separate the scopes. Every scope/context but the last one would be a namespace. 
For the last one, we can find the exact type.
2. PDB also contains a `UniqueName` field which can contain a mangled type 
name. Similar to 
[`CreateDeclInfoForType`](https://github.com/llvm/llvm-project/blob/a883a679165658bc6495e7d661dd52af02831250/lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp#L177-L190),
 the name could be demangled and each scope could be checked. 

In both cases, it's possible to try and get the parent to handle nested 
structs/enums/unions like in `CreateDeclInfoForType`.

https://github.com/llvm/llvm-project/pull/149876
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to