[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:35:59 PDT 2022
erichkeane added a comment.
In D133468#3799557 <https://reviews.llvm.org/D133468#3799557>, @mizvekov wrote:
> In D133468#3799522 <https://reviews.llvm.org/D133468#3799522>, @erichkeane wrote:
>
>> as far as `Divergent`, I wonder if we should call it something more descriptive, since it isn't just that it 'differs', it is that it is a non-canonical version, right?
>
> Well, currently without this patch TypedefTypes and UsingTypes can already have a non-canonical underlying type, it's just that we only store a reference to the declaration and we access the non-canonical type from there.
Ah, right, hrmph.
> The canonical type is still stored in the type itself, like any other type of course.
>
> "Divergent" is a term I came up with, but I would be all ears for a better alternative.
>
> I considered that calling it just `Different` but that didn't sound right, even though its synonymous.
>
> I considered calling it `hasDifferentUnderlyingTypefromDeclaration` but felt that was too verbose.
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`).
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.
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