[PATCH] D133468: [clang] Implement divergence for TypedefType and UsingType

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 19 07:51:14 PDT 2022


erichkeane accepted this revision.
erichkeane added a comment.
This revision is now accepted and ready to land.

In D133468#3799609 <https://reviews.llvm.org/D133468#3799609>, @mizvekov wrote:

> In D133468#3799572 <https://reviews.llvm.org/D133468#3799572>, @erichkeane wrote:
>
>> I agree with all of that, but still am not thrilled at 'Divergent', it isn't particularly descriptive... `Divergent` has some additional implications that I'm not sure we mean as well (that is, it isn't a perfect synonym for `different`).
>
> Yeah, it gives the sense of growing further apart, though that distinction would be meaningless for type nodes as they are not supposed to be mutable.
>
> Divergent is a term that is already used within `llvm` subproject, but not in Clang.
>
>> Perhaps something more like `hasLessCanonicalizedType` or `hasMoreSpecificType` or something like that?  I'm grasping a little, but I think I would like it to be more clear that we're storing the SAME type, just with additional sugar.
>
> Something like `hasDifferentSugaredType`, though that is still a bit on the long side.
>
> I also considered `resugared`, that would be my preferred alternative I think, as it's short and specific.
>
> One important consideration is that we will print this in the AST node dumper, so having a short name helps and we won't be compelled to use two different terms.

`hasDifferentSugaredType` is the best option I've seen so far.  I'm not in love with it, but it is definitely 'better'.  I don't think it is horrifyingly long, and we have similar length things throughout the codebase.  If you come up with something better, feel free to commit with it, else this patch LGTM.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133468



More information about the cfe-commits mailing list