gribozavr wrote:

> So from my undertstanding, IWYU only needs the SubstTemplateTypeParmType for 
> resugaring purposes, in order to recover the type as written by the user.
> 
> But with this patch we are doing the substitution already with sugar, so 
> there is no need to resugar, so IWYU shouldn't need the 
> SubstTemplateTypeParmType here anymore.

I agree that we don't need `SubstTemplateTypeParmType` nodes if all resuraging 
that we ever do is related to types that the Clang frontend itself knows. 
However that is not universally true.

For example, we (Google) have a tool for inferring and checking nullability 
contracts (https://github.com/google/crubit/tree/main/nullability). It relies 
on `SubstTemplateTypeParmType` nodes to propagate nullability annotations 
through template signatures. We can't rely on the Clang frontend doing this 
propagation because this logic is in an external tool.

So for all practical purposes, the removal of `SubstTemplateTypeParmType` is 
losing relevant information, and it means that no other tool can do the things 
that Clang frontend can.

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

Reply via email to