================ @@ -5216,6 +5237,25 @@ QualType ASTContext::getDependentBitIntType(bool IsUnsigned, return QualType(New, 0); } +QualType ASTContext::getPredefinedSugarType(uint32_t KD) const { + using Kind = PredefinedSugarType::Kind; + auto getUnderlyingType = [](const ASTContext &Ctx, Kind KDI) -> QualType { + switch (KDI) { + case Kind::SizeT: + return Ctx.getFromTargetType(Ctx.Target->getSizeType()); + case Kind::SignedSizeT: + return Ctx.getFromTargetType(Ctx.Target->getSignedSizeType()); + case Kind::PtrdiffT: + return Ctx.getFromTargetType(Ctx.Target->getPtrDiffType(LangAS::Default)); + } + llvm_unreachable("unexpected kind"); + }; + auto *New = new (*this, alignof(PredefinedSugarType)) PredefinedSugarType( ---------------- YexuanXiao wrote:
This function is used by TypeProperties.td and may not support `enum`s, similar to other definitions in same file. I recall attempting to use `enum`s before but failing. https://github.com/llvm/llvm-project/pull/143653 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits