[clang] [PATCH 1/4] [clang] Improve nested name specifier AST representation (PR #147835)
John McCall via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 10 11:56:10 PDT 2025
rjmccall wrote:
> > You should at minimum be able to layer the `NestedNameSpecifier` change on top of the `TagType` change. I can't see why that wouldn't work.
> >
> > 1. Add the structure for sugary `TagType`s.
> > 2. Replace `ElaboratedType` with sugary `TagType`s.
> > 3. Change the representation of NNS.
>
> Well it's not just TagTypes which were changed in order to not need ElaboratedType, everything else too (TypedefTypes, TemplateSpecializationTypes, etc).
>
> It would be really annoying to remove ElaboratedType from just TagType, leave it on everything else, while making every test pass, due for example how complicated some AST matchers would become in the intermediary state.
I actually don't see why. AST matching becomes heinously complicated in the *end* state of your change if you don't have methods to ask questions like "was this written as an elaborated type" or whatever else the client code in Sema is looking for. So presumably you do have those predicates, and the end state uses them. You can certainly implement those predicates in terms of `ElaboratedType` while it still exists. That should be patch 1.
https://github.com/llvm/llvm-project/pull/147835
More information about the cfe-commits
mailing list