[PATCH] D149677: [clang][TypePrinter] Add option to skip over elaborated types

Eric Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 17 09:51:28 PDT 2023


li.zhe.hua added a comment.

In D149677#4349523 <https://reviews.llvm.org/D149677#4349523>, @aaron.ballman wrote:

> In D149677#4320178 <https://reviews.llvm.org/D149677#4320178>, @li.zhe.hua wrote:
>
>> Some additional context: I'm working on a refactoring tool to, in part, deprecate an alias by replacing it with its definition. That functionality by itself could be provided through something like a clang-tidy, so I say "initially".
>
> We typically don't add new printing policies in tree without some need for them in the project itself (otherwise this becomes a maintenance problem), and I'm not certain I see a strong need for this to live in Clang. I think it might be best to wait until you're closer to having a clang-tidy check that would use this functionality before we continue with this patch. WDYT?

I believe there is value for having this option, as without it, the `PrintingCallbacks::isScopeVisible` callback is effectively useless in practice. It won't be triggered in non-canonical types because the `ElaboratedType` represents a fixed qualification on the name.

Note: there may be an argument for folding this functionality directly into `FullyQualifiedName` (which currently affects template-ids despite the comment on it suggesting it only is for function names). If the template name was elaborated, `FullyQualifiedName` does nothing, which seems inconsistent/incorrect.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149677/new/

https://reviews.llvm.org/D149677



More information about the cfe-commits mailing list