[libcxx-commits] [clang] [clang-tools-extra] [libcxx] [lldb] [Clang] Make the SizeType, SignedSizeType and PtrdiffType be named sugar types instead of built-in types (PR #143653)
Erich Keane via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jul 7 08:13:49 PDT 2025
================
@@ -2258,6 +2258,30 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
unsigned NumExpansions;
};
+ enum class PredefinedSugarKind {
+ /// The "size_t" type.
+ SizeT,
+
+ /// The signed integer type corresponding to "size_t".
+ SignedSizeT,
+
+ /// The "ptrdiff_t" type.
+ PtrdiffT,
+
+ // Indicates how many items the enum has.
+ NumElements
----------------
erichkeane wrote:
Right, I saw that. Just different-enough from how we create our enums + requires actually making sure it is in every 'switch'. Vs just doing `Last = PtrdiffT`, then:
` mutable std::array<Type *, llvm::to_underlying(PredefinedSugarType::Kind::Last +1)>`
Which is what we do elsewhere.
https://github.com/llvm/llvm-project/pull/143653
More information about the libcxx-commits
mailing list