[clang] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 14 00:42:31 PDT 2025


================
@@ -1480,6 +1480,14 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
       return false;
     break;
   }
+  case Type::PredefinedSugar: {
+    const auto *TP1 = cast<PredefinedSugarType>(T1);
+    const auto *TP2 = cast<PredefinedSugarType>(T2);
+
+    if (TP1->getKind() != TP2->getKind())
+      return false;
+    break;
----------------
mizvekov wrote:

If you have an underlying type, then this needs to do a structural comparison of the underlying types as well.

If you have just a fixed list with one type per kind, then just comparing the kinds is fine.

https://github.com/llvm/llvm-project/pull/143653


More information about the cfe-commits mailing list