[clang] [clang-tools-extra] [libcxx] [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 28 19:06:06 PDT 2025


================
@@ -2767,6 +2767,10 @@ class DependentBitIntTypeLoc final
     : public InheritingConcreteTypeLoc<TypeSpecTypeLoc, DependentBitIntTypeLoc,
                                        DependentBitIntType> {};
 
+class PredefinedSugarTypeLoc final
+    : public InheritingConcreteTypeLoc<TypeSpecTypeLoc, PredefinedSugarTypeLoc,
+                                       PredefinedSugarType> {};
----------------
mizvekov wrote:

Yeah, but for the current uses of PredefinedSugarType in this patch, we should never have to produce these TypeLocs, since this type is never written in source code.

It would be interesting to watch for this. I suspect that if we end up producing it, it would be because of some workaround somewhere, where some function expects a TypeLoc / TypeSourceInfo and we just produce a trivial one.

Likewise, serializing these TypeLocs seems also to be unnecessary.

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


More information about the cfe-commits mailing list