[PATCH] D137583: [lldb] Fix simple template names and template params with scope qualifiers
David Blaikie via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 9 11:19:24 PST 2022
dblaikie added a comment.
In D137583#3917706 <https://reviews.llvm.org/D137583#3917706>, @aaron.ballman wrote:
>> ...we expect template params to be fully qualified when comparing them for simple template names
>
> So lldb is not inspecting the AST, they're doing reflection (of a sort) on the pretty printed names? Or am I misunderstanding something?
Not reflection as such - but building names for the user, but partly from the AST - basically LLDB wants to be able to produce the same name that CGDebugInfo produces - so, maybe it should produce it the same way as CGDebugInfo, which isn't to use the pretty printer from scratch.
@aeubanks would this work for lldb's use case? https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CGDebugInfo.cpp#L5229 it'd be identical to the original debug info generation, and looks like it doesn't require a printing policy change/feature. Sorry I didn't think of that earlier. I guess since `Qualified` would be `false` for lldb's use case, you could go down into the implementation and just call the unqualified side directly: `NamedDecl::printName(OS, Policy);` should print it unqualified for this name, but respect the qualified printing policy flag for any nested names, parameters, etc.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137583/new/
https://reviews.llvm.org/D137583
More information about the cfe-commits
mailing list