[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 06:36:59 PDT 2022


erichkeane added a comment.

I'm still having trouble from the description and test figuring out what this means.  Can you better clarify the intent/effect of this?

Is the point that the type-aliases could also store a non-canonicalized type?  if so, perhaps the patch should better reflect that (AND, perhaps do some assertions to make sure we don't unintentionally store types that don't canonicalize identically).



================
Comment at: clang/include/clang/AST/Type.h:1802
+    /// True if the underlying diverges from the declared one.
+    unsigned isDivergent : 1;
+  };
----------------
It isn't clear to me what you mean by 'diverges' and 'divergent here.


================
Comment at: clang/lib/AST/Type.cpp:3443
+  if (isDivergent())
+    *reinterpret_cast<QualType *>(this + 1) = Underlying;
 }
----------------
this bit doesn't seem right to me.  Why isn't this using the normal setter here?  Or even the trailing objects setter?


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