[PATCH] D137583: [lldb] Fix simple template names and template params with scope qualifiers

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 11 13:39:23 PST 2022


aeubanks added a comment.

In D137583#3917735 <https://reviews.llvm.org/D137583#3917735>, @dblaikie wrote:

> 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.

much better, thanks!


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