;
58 return(*
this!=
Other) &&
115getElementType().getBaseTypeIdentifier();
133 if(
T.isConstQualified())
137 returnAT->getElementType().isConstant(Ctx);
142std::optional<QualType::NonConstantStorageReason>
145 if(!
isConstant(Ctx) && !(*this)->isReferenceType())
153 if(
Record->hasMutableFields())
155 if(!
Record->hasTrivialDestructor() && !ExcludeDtor)
175et->getDependence() |
181(tc == DependentSizedArray
191 constllvm::APInt &Sz,
const Expr*SzExpr,
193 boolNeedsExternalSize = SzExpr !=
nullptr|| Sz.ugt(0x0FFFFFFFFFFFFFFF) ||
194Sz.getBitWidth() > 0xFF;
195 if(!NeedsExternalSize)
197ET, Can, Sz.getBitWidth(), Sz.getZExtValue(), SzMod, Qual);
199 auto*SzPtr =
new(Ctx,
alignof(ConstantArrayType::ExternalSize))
200ConstantArrayType::ExternalSize(Sz, SzExpr);
207 constllvm::APInt &NumElements) {
216 if(llvm::isPowerOf2_64(ElementSize)) {
217 returnNumElements.getActiveBits() + llvm::Log2_64(ElementSize);
222 if((ElementSize >> 32) == 0 && NumElements.getBitWidth() <= 64 &&
223(NumElements.getZExtValue() >> 32) == 0) {
224uint64_t TotalSize = NumElements.getZExtValue() * ElementSize;
225 returnllvm::bit_width(TotalSize);
229llvm::APSInt SizeExtended(NumElements,
true);
231SizeExtended = SizeExtended.extend(std::max(SizeTypeBits,
232SizeExtended.getBitWidth()) * 2);
234llvm::APSInt TotalSize(llvm::APInt(SizeExtended.getBitWidth(), ElementSize));
235TotalSize *= SizeExtended;
237 returnTotalSize.getActiveBits();
259uint64_t ArraySize,
const Expr*SizeExpr,
262ID.AddInteger(ArraySize);
263ID.AddInteger(llvm::to_underlying(SizeMod));
264ID.AddInteger(TypeQuals);
265ID.AddBoolean(SizeExpr !=
nullptr);
267SizeExpr->
Profile(ID, Context,
true);
276DependentSizedArrayType::DependentSizedArrayType(
QualTypeet,
QualTypecan,
280:
ArrayType(DependentSizedArray, et, can, sm, tq, e), SizeExpr((
Stmt*)e),
281Brackets(brackets) {}
290ID.AddInteger(llvm::to_underlying(SizeMod));
291ID.AddInteger(TypeQuals);
296DependentVectorType::DependentVectorType(
QualTypeElementType,
299:
Type(DependentVector, CanonType,
301ElementType->getDependence() |
304ElementType(ElementType), SizeExpr(SizeExpr),
Loc(
Loc) {
313ID.AddInteger(llvm::to_underlying(VecKind));
314SizeExpr->
Profile(ID, Context,
true);
317DependentSizedExtVectorType::DependentSizedExtVectorType(
QualTypeElementType,
321:
Type(DependentSizedExtVector, can,
323ElementType->getDependence() |
326SizeExpr(SizeExpr), ElementType(ElementType), loc(loc) {}
333SizeExpr->
Profile(ID, Context,
true);
336DependentAddressSpaceType::DependentAddressSpaceType(
QualTypePointeeType,
340:
Type(DependentAddressSpace, can,
342PointeeType->getDependence() |
345AddrSpaceExpr(AddrSpaceExpr), PointeeType(PointeeType), loc(loc) {}
350 Expr*AddrSpaceExpr) {
352AddrSpaceExpr->
Profile(ID, Context,
true);
356 const Expr*RowExpr,
const Expr*ColumnExpr)
357:
Type(tc, canonType,
360(matrixType->isVariablyModifiedType()
363(matrixType->containsUnexpandedParameterPack() ||
365RowExpr->containsUnexpandedParameterPack()) ||
367ColumnExpr->containsUnexpandedParameterPack())
370: matrixType->getDependence())),
371ElementType(matrixType) {}
374 unsignednColumns,
QualTypecanonType)
379 unsignednRows,
unsignednColumns,
381:
MatrixType(tc, matrixType, canonType), NumRows(nRows),
382NumColumns(nColumns) {}
384DependentSizedMatrixType::DependentSizedMatrixType(
QualTypeElementType,
389:
MatrixType(DependentSizedMatrix, ElementType, CanonicalType, RowExpr,
391RowExpr(RowExpr), ColumnExpr(ColumnExpr), loc(loc) {}
398RowExpr->
Profile(ID, CTX,
true);
399ColumnExpr->
Profile(ID, CTX,
true);
408:
Type(tc, canonType, vecType->getDependence()), ElementType(vecType) {
420ExprAndUnsigned(NumBitsExpr, IsUnsigned) {}
423 returnExprAndUnsigned.getInt();
427 returnExprAndUnsigned.getPointer();
433ID.AddBoolean(IsUnsigned);
434NumBitsExpr->
Profile(ID, Context,
true);
440 returnisa<FieldDecl>(Info.
getDecl());
446 boolCountInBytes,
boolOrNull) {
448ID.AddBoolean(CountInBytes);
449ID.AddBoolean(OrNull);
454ID.AddPointer(CountExpr);
462 if(
const auto*ATy = dyn_cast<ArrayType>(
this))
463 returnATy->getElementType().getTypePtr();
466 if(!isa<ArrayType>(CanonicalType))
472->getElementType().getTypePtr();
496#define TYPE(CLASS, BASE) \ 497 static_assert(!std::is_polymorphic<CLASS##Type>::value, \ 498 #CLASS "Type should not be polymorphic!");
499#include "clang/AST/TypeNodes.inc" 504#define TYPE(CLASS, BASE) \ 505 static_assert(std::is_trivially_destructible<CLASS##Type>::value, \ 506 #CLASS "Type should be trivially destructible!");
507#include "clang/AST/TypeNodes.inc" 511#define ABSTRACT_TYPE(Class, Parent) 512#define TYPE(Class, Parent) \ 513 case Type::Class: { \ 514 const auto *ty = cast<Class##Type>(this); \ 515 if (!ty->isSugared()) return QualType(ty, 0); \ 516 return ty->desugar(); \ 518#include "clang/AST/TypeNodes.inc" 520llvm_unreachable(
"bad type kind!");
530#define ABSTRACT_TYPE(Class, Parent) 531#define TYPE(Class, Parent) \ 532 case Type::Class: { \ 533 const auto *Ty = cast<Class##Type>(CurTy); \ 534 if (!Ty->isSugared()) \ 535 return SplitQualType(Ty, Qs); \ 536 Cur = Ty->desugar(); \ 539#include "clang/AST/TypeNodes.inc" 559#define ABSTRACT_TYPE(Class, Parent) 560#define TYPE(Class, Parent) \ 561 case Type::Class: { \ 562 const auto *ty = cast<Class##Type>(split.Ty); \ 563 if (!ty->isSugared()) goto done; \ 564 next = ty->desugar(); \ 567#include "clang/AST/TypeNodes.inc" 574lastTypeWithQuals =
split.
Ty;
586 T= PT->getInnerType();
595 if(
const auto*Sugar = dyn_cast<T>(Cur))
598#define ABSTRACT_TYPE(Class, Parent) 599#define TYPE(Class, Parent) \ 600 case Type::Class: { \ 601 const auto *Ty = cast<Class##Type>(Cur); \ 602 if (!Ty->isSugared()) return 0; \ 603 Cur = Ty->desugar().getTypePtr(); \ 606#include "clang/AST/TypeNodes.inc" 612 returngetAsSugar<TypedefType>(
this);
616 returngetAsSugar<UsingType>(
this);
620 returngetAsSugar<TemplateSpecializationType>(
this);
624 returngetAsSugar<AttributedType>(
this);
628 returngetAsSugar<BoundsAttributedType>(
this);
632 returngetAsSugar<CountAttributedType>(
this);
639 const Type*Cur =
this;
643#define ABSTRACT_TYPE(Class, Parent) 644#define TYPE(Class, Parent) \ 646 const auto *Ty = cast<Class##Type>(Cur); \ 647 if (!Ty->isSugared()) return Cur; \ 648 Cur = Ty->desugar().getTypePtr(); \ 651#include "clang/AST/TypeNodes.inc" 657 if(
const auto*RT = getAs<RecordType>())
658 returnRT->getDecl()->isClass();
663 if(
const auto*RT = getAs<RecordType>())
664 returnRT->getDecl()->isStruct();
669 const auto*RT = getAs<RecordType>();
672 const auto*
Decl= RT->getDecl();
673 if(!
Decl->isStruct())
675 return Decl->hasFlexibleArrayMember();
679 if(
const auto*RT = getAs<RecordType>())
680 returnRT->getDecl()->hasAttr<ObjCBoxableAttr>();
685 if(
const auto*RT = getAs<RecordType>())
686 returnRT->getDecl()->isInterface();
691 if(
const auto*RT = getAs<RecordType>()) {
699 if(
const auto*PT = getAs<PointerType>())
700 returnPT->getPointeeType()->isVoidType();
705 if(
const auto*RT = getAs<RecordType>())
706 returnRT->getDecl()->isUnion();
711 if(
const auto*CT = dyn_cast<ComplexType>(CanonicalType))
712 returnCT->getElementType()->isFloatingType();
722 if(
const auto*ET = getAs<EnumType>())
723 returnET->getDecl()->isScoped();
728 returngetAs<CountAttributedType>();
732 if(
const auto*
Complex= getAs<ComplexType>())
733 if(
Complex->getElementType()->isIntegerType())
739 if(
const auto*PT = getAs<PointerType>())
741 if(
const auto*OPT = getAs<ObjCObjectPointerType>())
743 if(
const auto*BPT = getAs<BlockPointerType>())
745 if(
const auto*RT = getAs<ReferenceType>())
747 if(
const auto*MPT = getAs<MemberPointerType>())
749 if(
const auto*DT = getAs<DecayedType>())
756 if(
const auto*RT = dyn_cast<RecordType>(
this)) {
757 if(RT->getDecl()->isStruct())
762 if(
const auto*RT = dyn_cast<RecordType>(CanonicalType)) {
763 if(!RT->getDecl()->isStruct())
775 if(
const auto*RT = dyn_cast<RecordType>(
this)) {
776 if(RT->getDecl()->isUnion())
781 if(
const auto*RT = dyn_cast<RecordType>(CanonicalType)) {
782 if(!RT->getDecl()->isUnion())
797 const auto*OPT = getAs<ObjCObjectPointerType>();
802 if(OPT->isObjCIdType())
806 if(!OPT->isKindOfType())
810 if(OPT->isObjCClassType() || OPT->isObjCQualifiedClassType())
820 const auto*OPT = getAs<ObjCObjectPointerType>();
825 if(OPT->isObjCClassType())
829 if(!OPT->isKindOfType())
833 returnOPT->isObjCClassType() || OPT->isObjCQualifiedClassType();
847:
Type(ObjCObject, Canonical,
Base->getDependence()), BaseType(
Base) {
852 "bitfield overflow in type argument count");
853 if(!typeArgs.empty())
854 memcpy(getTypeArgStorage(), typeArgs.data(),
855typeArgs.size() *
sizeof(
QualType));
857 for(
autotypeArg : typeArgs) {
858 addDependence(typeArg->getDependence() & ~TypeDependence::VariablyModified);
871 if(
const autoobjcObject =
getBaseType()->getAs<ObjCObjectType>()) {
873 if(isa<ObjCInterfaceType>(objcObject))
876 returnobjcObject->isSpecialized();
889 if(
const autoobjcObject =
getBaseType()->getAs<ObjCObjectType>()) {
891 if(isa<ObjCInterfaceType>(objcObject))
894 returnobjcObject->getTypeArgs();
906 if(
const autoobjcObject =
getBaseType()->getAs<ObjCObjectType>()) {
908 if(isa<ObjCInterfaceType>(objcObject))
911 returnobjcObject->isKindOfType();
927baseType = baseObj->stripObjCKindOfTypeAndQuals(ctx);
930splitBaseType.
Quals),
956template<
typenameDerived>
957structSimpleTransformVisitor :
public TypeVisitor<Derived, QualType> {
965 QualTyperesult =
static_cast<Derived *
>(
this)->Visit(splitType.
Ty);
975 explicitSimpleTransformVisitor(
ASTContext&ctx) : Ctx(ctx) {}
979#define TYPE(Class, Base) 980#define DEPENDENT_TYPE(Class, Base) \ 981 QualType Visit##Class##Type(const Class##Type *T) { return QualType(T, 0); } 982#include "clang/AST/TypeNodes.inc" 984#define TRIVIAL_TYPE_CLASS(Class) \ 985 QualType Visit##Class##Type(const Class##Type *T) { return QualType(T, 0); } 986#define SUGARED_TYPE_CLASS(Class) \ 987 QualType Visit##Class##Type(const Class##Type *T) { \ 988 if (!T->isSugared()) \ 989 return QualType(T, 0); \ 990 QualType desugaredType = recurse(T->desugar()); \ 991 if (desugaredType.isNull()) \ 993 if (desugaredType.getAsOpaquePtr() == T->desugar().getAsOpaquePtr()) \ 994 return QualType(T, 0); \ 995 return desugaredType; \ 1001 QualTypeelementType = recurse(
T->getElementType());
1002 if(elementType.
isNull())
1005 if(elementType.
getAsOpaquePtr() ==
T->getElementType().getAsOpaquePtr())
1013 if(pointeeType.
isNull())
1024 if(pointeeType.
isNull())
1034 QualTypepointeeType = recurse(
T->getPointeeTypeAsWritten());
1035 if(pointeeType.
isNull())
1039==
T->getPointeeTypeAsWritten().getAsOpaquePtr())
1046 QualTypepointeeType = recurse(
T->getPointeeTypeAsWritten());
1047 if(pointeeType.
isNull())
1051==
T->getPointeeTypeAsWritten().getAsOpaquePtr())
1059 if(pointeeType.
isNull())
1069 QualTypeelementType = recurse(
T->getElementType());
1070 if(elementType.
isNull())
1073 if(elementType.
getAsOpaquePtr() ==
T->getElementType().getAsOpaquePtr())
1077 T->getSizeModifier(),
1078 T->getIndexTypeCVRQualifiers());
1082 QualTypeelementType = recurse(
T->getElementType());
1083 if(elementType.
isNull())
1086 if(elementType.
getAsOpaquePtr() ==
T->getElementType().getAsOpaquePtr())
1090 T->getSizeModifier(),
1091 T->getIndexTypeCVRQualifiers(),
1092 T->getBracketsRange());
1096 QualTypeelementType = recurse(
T->getElementType());
1097 if(elementType.
isNull())
1100 if(elementType.
getAsOpaquePtr() ==
T->getElementType().getAsOpaquePtr())
1104 T->getIndexTypeCVRQualifiers());
1108 QualTypeelementType = recurse(
T->getElementType());
1109 if(elementType.
isNull())
1112 if(elementType.
getAsOpaquePtr() ==
T->getElementType().getAsOpaquePtr())
1116 T->getVectorKind());
1120 QualTypeelementType = recurse(
T->getElementType());
1121 if(elementType.
isNull())
1124 if(elementType.
getAsOpaquePtr() ==
T->getElementType().getAsOpaquePtr())
1131 QualTypeelementType = recurse(
T->getElementType());
1132 if(elementType.
isNull())
1134 if(elementType.
getAsOpaquePtr() ==
T->getElementType().getAsOpaquePtr())
1138 T->getNumColumns());
1143 if(returnType.
isNull())
1154 if(returnType.
isNull())
1159 boolparamChanged =
false;
1161 QualTypenewParamType = recurse(paramType);
1162 if(newParamType.
isNull())
1165 if(newParamType.
getAsOpaquePtr() != paramType.getAsOpaquePtr())
1166paramChanged =
true;
1168paramTypes.push_back(newParamType);
1173 boolexceptionChanged =
false;
1177 QualTypenewExceptionType = recurse(exceptionType);
1178 if(newExceptionType.
isNull())
1181 if(newExceptionType.
getAsOpaquePtr() != exceptionType.getAsOpaquePtr())
1182exceptionChanged =
true;
1184exceptionTypes.push_back(newExceptionType);
1187 if(exceptionChanged) {
1194!paramChanged && !exceptionChanged)
1201 QualTypeinnerType = recurse(
T->getInnerType());
1202 if(innerType.
isNull())
1205 if(innerType.
getAsOpaquePtr() ==
T->getInnerType().getAsOpaquePtr())
1216 QualTypeoriginalType = recurse(
T->getOriginalType());
1217 if(originalType.
isNull())
1220 QualTypeadjustedType = recurse(
T->getAdjustedType());
1221 if(adjustedType.
isNull())
1225==
T->getOriginalType().getAsOpaquePtr() &&
1226adjustedType.
getAsOpaquePtr() ==
T->getAdjustedType().getAsOpaquePtr())
1233 QualTypeoriginalType = recurse(
T->getOriginalType());
1234 if(originalType.
isNull())
1238==
T->getOriginalType().getAsOpaquePtr())
1245 QualTypeArrTy = VisitConstantArrayType(
T);
1263 QualTypemodifiedType = recurse(
T->getModifiedType());
1264 if(modifiedType.
isNull())
1267 QualTypeequivalentType = recurse(
T->getEquivalentType());
1268 if(equivalentType.
isNull())
1272==
T->getModifiedType().getAsOpaquePtr() &&
1274==
T->getEquivalentType().getAsOpaquePtr())
1282 QualTypereplacementType = recurse(
T->getReplacementType());
1283 if(replacementType.
isNull())
1287==
T->getReplacementType().getAsOpaquePtr())
1291 T->getAssociatedDecl(),
1292 T->getIndex(),
T->getPackIndex());
1299 if(!
T->isDeduced())
1302 QualTypededucedType = recurse(
T->getDeducedType());
1303 if(deducedType.
isNull())
1307==
T->getDeducedType().getAsOpaquePtr())
1310 returnCtx.
getAutoType(deducedType,
T->getKeyword(),
1312 T->getTypeConstraintConcept(),
1313 T->getTypeConstraintArguments());
1317 QualTypebaseType = recurse(
T->getBaseType());
1322 booltypeArgChanged =
false;
1324 for(
autotypeArg :
T->getTypeArgsAsWritten()) {
1325 QualTypenewTypeArg = recurse(typeArg);
1326 if(newTypeArg.
isNull())
1330typeArgChanged =
true;
1332typeArgs.push_back(newTypeArg);
1335 if(baseType.
getAsOpaquePtr() ==
T->getBaseType().getAsOpaquePtr() &&
1342 T->isKindOfTypeAsWritten());
1349 if(pointeeType.
isNull())
1360 QualTypevalueType = recurse(
T->getValueType());
1361 if(valueType.
isNull())
1365==
T->getValueType().getAsOpaquePtr())
1371#undef TRIVIAL_TYPE_CLASS 1372#undef SUGARED_TYPE_CLASS 1375structSubstObjCTypeArgsVisitor
1376:
publicSimpleTransformVisitor<SubstObjCTypeArgsVisitor> {
1377 usingBaseType = SimpleTransformVisitor<SubstObjCTypeArgsVisitor>;
1384: BaseType(ctx), TypeArgs(typeArgs), SubstContext(context) {}
1391 if(!TypeArgs.empty()) {
1402argType, protocolsToApply, hasError,
true);
1405 switch(SubstContext) {
1406 caseObjCSubstitutionContext::Ordinary:
1407 caseObjCSubstitutionContext::Parameter:
1408 caseObjCSubstitutionContext::Superclass:
1412 caseObjCSubstitutionContext::Result:
1413 caseObjCSubstitutionContext::Property: {
1415 const auto*objPtr =
1420 if(objPtr->isKindOfType() || objPtr->isObjCIdOrClassType())
1424 const auto*obj = objPtr->getObjectType();
1426obj->getBaseType(), obj->getTypeArgsAsWritten(), obj->getProtocols(),
1433llvm_unreachable(
"Unexpected ObjCSubstitutionContext!");
1442Ctx, TypeArgs, ObjCSubstitutionContext::Result);
1443 if(returnType.
isNull())
1448 if(isa<FunctionNoProtoType>(funcType)) {
1452 returnBaseType::VisitFunctionType(funcType);
1458 const auto*funcProtoType = cast<FunctionProtoType>(funcType);
1462 boolparamChanged =
false;
1463 for(
autoparamType : funcProtoType->getParamTypes()) {
1465Ctx, TypeArgs, ObjCSubstitutionContext::Parameter);
1466 if(newParamType.
isNull())
1469 if(newParamType.
getAsOpaquePtr() != paramType.getAsOpaquePtr())
1470paramChanged =
true;
1472paramTypes.push_back(newParamType);
1477 boolexceptionChanged =
false;
1482Ctx, TypeArgs, ObjCSubstitutionContext::Ordinary);
1483 if(newExceptionType.
isNull())
1486 if(newExceptionType.
getAsOpaquePtr() != exceptionType.getAsOpaquePtr())
1487exceptionChanged =
true;
1489exceptionTypes.push_back(newExceptionType);
1492 if(exceptionChanged) {
1499funcProtoType->getReturnType().getAsOpaquePtr() &&
1500!paramChanged && !exceptionChanged)
1501 returnBaseType::VisitFunctionType(funcType);
1511 boolanyChanged =
false;
1514Ctx, TypeArgs, ObjCSubstitutionContext::Ordinary);
1515 if(newTypeArg.
isNull())
1523 if(TypeArgs.empty() &&
1524SubstContext != ObjCSubstitutionContext::Superclass) {
1533newTypeArgs.push_back(newTypeArg);
1545 returnBaseType::VisitObjCObjectType(objcObjectType);
1549 QualTypenewType = BaseType::VisitAttributedType(attrType);
1553 const auto*newAttrType = dyn_cast<AttributedType>(newType.
getTypePtr());
1554 if(!newAttrType || newAttrType->getAttrKind() != attr::ObjCKindOf)
1558 QualTypenewEquivType = newAttrType->getEquivalentType();
1570objType->getBaseType(), objType->getTypeArgsAsWritten(),
1571objType->getProtocols(),
1573objType->isObjCUnqualifiedId() ?
false:
true);
1581newAttrType->getModifiedType(), newEquivType,
1582newAttrType->getAttr());
1586structStripObjCKindOfTypeVisitor
1587:
publicSimpleTransformVisitor<StripObjCKindOfTypeVisitor> {
1588 usingBaseType = SimpleTransformVisitor<StripObjCKindOfTypeVisitor>;
1590 explicitStripObjCKindOfTypeVisitor(
ASTContext&ctx) : BaseType(ctx) {}
1594 returnBaseType::VisitObjCObjectType(objType);
1615 caseBuiltinType::Kind::Float16: {
1618Ctx.
getLangOpts().getFloat16ExcessPrecision() !=
1619Ctx.
getLangOpts().ExcessPrecisionKind::FPP_None)
1623 caseBuiltinType::Kind::BFloat16: {
1626Ctx.
getLangOpts().getBFloat16ExcessPrecision() !=
1627Ctx.
getLangOpts().ExcessPrecisionKind::FPP_None)
1643SubstObjCTypeArgsVisitor visitor(ctx, typeArgs, context);
1644 returnvisitor.recurse(*
this);
1658 auto&ctx =
const_cast<ASTContext&
>(constCtx);
1659StripObjCKindOfTypeVisitor visitor(ctx);
1660 returnvisitor.recurse(*
this);
1666 T= AT->getValueType();
1667 return T.getUnqualifiedType();
1670std::optional<ArrayRef<QualType>>
1673 if(
const automethod = dyn_cast<ObjCMethodDecl>(dc))
1674dc = method->getDeclContext();
1678 const auto*dcClassDecl = dyn_cast<ObjCInterfaceDecl>(dc);
1684dcTypeParams = dcClassDecl->getTypeParamList();
1686 returnstd::nullopt;
1690dcCategoryDecl = dyn_cast<ObjCCategoryDecl>(dc);
1691 if(!dcCategoryDecl)
1692 returnstd::nullopt;
1698 returnstd::nullopt;
1702 returnstd::nullopt;
1704assert(dcTypeParams &&
"No substitutions to perform");
1705assert(dcClassDecl &&
"No class context");
1709 if(
const auto*objectPointerType = getAs<ObjCObjectPointerType>()) {
1710objectType = objectPointerType->getObjectType();
1711}
else if(getAs<BlockPointerType>()) {
1716objectType = getAs<ObjCObjectType>();
1722 if(!curClassDecl) {
1730 while(curClassDecl != dcClassDecl) {
1733 if(superType.
isNull()) {
1734objectType =
nullptr;
1754 if(
auto*ID = IfaceT->getInterface()) {
1755 if(ID->getTypeParamList())
1769CachedSuperClassType.setInt(
true);
1775 if(!superClassObjTy) {
1776CachedSuperClassType.setInt(
true);
1781 if(!superClassDecl) {
1782CachedSuperClassType.setInt(
true);
1788 QualTypesuperClassType(superClassObjTy, 0);
1790 if(!superClassTypeParams) {
1791CachedSuperClassType.setPointerAndInt(
1798CachedSuperClassType.setPointerAndInt(superClassObjTy,
true);
1806CachedSuperClassType.setPointerAndInt(
1817CachedSuperClassType.setPointerAndInt(
1825assert(typeArgs.size() == typeParams->
size());
1826CachedSuperClassType.setPointerAndInt(
1834 if(
autointerfaceDecl =
getObjectType()->getInterface()) {
1835 returninterfaceDecl->getASTContext().getObjCInterfaceType(interfaceDecl)
1844 if(superObjectType.
isNull())
1845 returnsuperObjectType;
1855 if(
const auto*
T= getAs<ObjCObjectType>())
1856 if(
T->getNumProtocols() &&
T->getInterface())
1868 if(
const auto*OPT = getAs<ObjCObjectPointerType>()) {
1869 if(OPT->isObjCQualifiedIdType())
1878 if(
const auto*OPT = getAs<ObjCObjectPointerType>()) {
1879 if(OPT->isObjCQualifiedClassType())
1886 if(
const auto*OT = getAs<ObjCObjectType>()) {
1887 if(OT->getInterface())
1894 if(
const auto*OPT = getAs<ObjCObjectPointerType>()) {
1895 if(OPT->getInterfaceType())
1903 if(
const auto*PT = getAs<PointerType>())
1905 else if(
const auto*RT = getAs<ReferenceType>())
1911 returndyn_cast<CXXRecordDecl>(RT->getDecl());
1917 returndyn_cast_or_null<CXXRecordDecl>(
getAsTagDecl());
1925 if(
const auto*TT = getAs<TagType>())
1926 returnTT->getDecl();
1927 if(
const auto*Injected = getAs<InjectedClassNameType>())
1928 returnInjected->getDecl();
1934 const Type*Cur =
this;
1936 if(AT->getAttrKind() == AK)
1938Cur = AT->getEquivalentType().getTypePtr();
1945 classGetContainedDeducedTypeVisitor :
1946 public TypeVisitor<GetContainedDeducedTypeVisitor, Type*> {
1950GetContainedDeducedTypeVisitor(
boolSyntactic =
false)
1951: Syntactic(Syntactic) {}
1958 returnVisit(
T.getTypePtr());
1968 returnVisit(
T->getReplacementType());
1972 returnVisit(
T->getNamedType());
1984 returnVisit(
T->getPointeeTypeAsWritten());
1992 returnVisit(
T->getElementType());
1995 Type*VisitDependentSizedExtVectorType(
1997 returnVisit(
T->getElementType());
2001 returnVisit(
T->getElementType());
2005 returnVisit(
T->getElementType());
2009 returnVisit(
T->getElementType());
2015 returnVisitFunctionType(
T);
2023 returnVisit(
T->getInnerType());
2027 returnVisit(
T->getModifiedType());
2031 returnVisit(
T->getUnderlyingType());
2035 returnVisit(
T->getOriginalType());
2039 returnVisit(
T->getPattern());
2046 returncast_or_null<DeducedType>(
2047GetContainedDeducedTypeVisitor().Visit(
this));
2051 returnisa_and_nonnull<FunctionType>(
2052GetContainedDeducedTypeVisitor(
true).Visit(
this));
2056 if(
const auto*VT = dyn_cast<VectorType>(CanonicalType))
2057 returnVT->getElementType()->isIntegerType();
2058 if(CanonicalType->isSveVLSBuiltinType()) {
2059 const auto*VT = cast<BuiltinType>(CanonicalType);
2060 returnVT->getKind() == BuiltinType::SveBool ||
2061(VT->getKind() >= BuiltinType::SveInt8 &&
2062VT->getKind() <= BuiltinType::SveUint64);
2064 if(CanonicalType->isRVVVLSBuiltinType()) {
2065 const auto*VT = cast<BuiltinType>(CanonicalType);
2066 return(VT->getKind() >= BuiltinType::RvvInt8mf8 &&
2067VT->getKind() <= BuiltinType::RvvUint64m8);
2093 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType))
2094 returnBT->getKind() >= BuiltinType::Bool &&
2095BT->getKind() <= BuiltinType::Int128;
2099 if(
const auto*ET = dyn_cast<EnumType>(CanonicalType))
2100 returnET->getDecl()->isComplete();
2106 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType))
2107 returnBT->getKind() >= BuiltinType::Bool &&
2108BT->getKind() <= BuiltinType::Int128;
2117 if(
const auto*ET = dyn_cast<EnumType>(CanonicalType))
2118 return!ET->getDecl()->isScoped();
2124 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType))
2125 returnBT->getKind() == BuiltinType::Char_U ||
2126BT->getKind() == BuiltinType::UChar ||
2127BT->getKind() == BuiltinType::Char_S ||
2128BT->getKind() == BuiltinType::SChar;
2133 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType))
2134 returnBT->getKind() == BuiltinType::WChar_S ||
2135BT->getKind() == BuiltinType::WChar_U;
2140 if(
const BuiltinType*BT = dyn_cast<BuiltinType>(CanonicalType))
2141 returnBT->getKind() == BuiltinType::Char8;
2146 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType))
2147 returnBT->getKind() == BuiltinType::Char16;
2152 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType))
2153 returnBT->getKind() == BuiltinType::Char32;
2160 const auto*BT = dyn_cast<BuiltinType>(CanonicalType);
2161 if(!BT)
return false;
2162 switch(BT->getKind()) {
2163 default:
return false;
2164 caseBuiltinType::Char_U:
2165 caseBuiltinType::UChar:
2166 caseBuiltinType::WChar_U:
2167 caseBuiltinType::Char8:
2168 caseBuiltinType::Char16:
2169 caseBuiltinType::Char32:
2170 caseBuiltinType::Char_S:
2171 caseBuiltinType::SChar:
2172 caseBuiltinType::WChar_S:
2181 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType)) {
2182 returnBT->getKind() >= BuiltinType::Char_S &&
2183BT->getKind() <= BuiltinType::Int128;
2186 if(
const EnumType*ET = dyn_cast<EnumType>(CanonicalType)) {
2189 if(ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
2193 if(
const auto*IT = dyn_cast<BitIntType>(CanonicalType))
2194 returnIT->isSigned();
2195 if(
const auto*IT = dyn_cast<DependentBitIntType>(CanonicalType))
2196 returnIT->isSigned();
2202 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType)) {
2203 returnBT->getKind() >= BuiltinType::Char_S &&
2204BT->getKind() <= BuiltinType::Int128;
2207 if(
const auto*ET = dyn_cast<EnumType>(CanonicalType)) {
2208 if(ET->getDecl()->isComplete())
2212 if(
const auto*IT = dyn_cast<BitIntType>(CanonicalType))
2213 returnIT->isSigned();
2214 if(
const auto*IT = dyn_cast<DependentBitIntType>(CanonicalType))
2215 returnIT->isSigned();
2221 if(
const auto*VT = dyn_cast<VectorType>(CanonicalType))
2222 returnVT->getElementType()->isSignedIntegerOrEnumerationType();
2231 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType)) {
2232 returnBT->getKind() >= BuiltinType::Bool &&
2233BT->getKind() <= BuiltinType::UInt128;
2236 if(
const auto*ET = dyn_cast<EnumType>(CanonicalType)) {
2239 if(ET->getDecl()->isComplete() && !ET->getDecl()->isScoped())
2243 if(
const auto*IT = dyn_cast<BitIntType>(CanonicalType))
2244 returnIT->isUnsigned();
2245 if(
const auto*IT = dyn_cast<DependentBitIntType>(CanonicalType))
2246 returnIT->isUnsigned();
2252 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType)) {
2253 returnBT->getKind() >= BuiltinType::Bool &&
2254BT->getKind() <= BuiltinType::UInt128;
2257 if(
const auto*ET = dyn_cast<EnumType>(CanonicalType)) {
2258 if(ET->getDecl()->isComplete())
2262 if(
const auto*IT = dyn_cast<BitIntType>(CanonicalType))
2263 returnIT->isUnsigned();
2264 if(
const auto*IT = dyn_cast<DependentBitIntType>(CanonicalType))
2265 returnIT->isUnsigned();
2271 if(
const auto*VT = dyn_cast<VectorType>(CanonicalType))
2272 returnVT->getElementType()->isUnsignedIntegerOrEnumerationType();
2273 if(
const auto*VT = dyn_cast<MatrixType>(CanonicalType))
2274 returnVT->getElementType()->isUnsignedIntegerOrEnumerationType();
2275 if(CanonicalType->isSveVLSBuiltinType()) {
2276 const auto*VT = cast<BuiltinType>(CanonicalType);
2277 returnVT->getKind() >= BuiltinType::SveUint8 &&
2278VT->getKind() <= BuiltinType::SveUint64;
2284 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType))
2285 returnBT->getKind() >= BuiltinType::Half &&
2286BT->getKind() <= BuiltinType::Ibm128;
2287 if(
const auto*CT = dyn_cast<ComplexType>(CanonicalType))
2288 returnCT->getElementType()->isFloatingType();
2293 if(
const auto*VT = dyn_cast<VectorType>(CanonicalType))
2294 returnVT->getElementType()->isFloatingType();
2295 if(
const auto*MT = dyn_cast<MatrixType>(CanonicalType))
2296 returnMT->getElementType()->isFloatingType();
2301 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType))
2302 returnBT->isFloatingPoint();
2307 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType))
2308 returnBT->getKind() >= BuiltinType::Bool &&
2309BT->getKind() <= BuiltinType::Ibm128;
2310 if(
const auto*ET = dyn_cast<EnumType>(CanonicalType))
2311 returnET->getDecl()->isComplete() && !ET->getDecl()->isScoped();
2316 if(
const auto*BT = dyn_cast<BuiltinType>(CanonicalType))
2317 returnBT->getKind() >= BuiltinType::Bool &&
2318BT->getKind() <= BuiltinType::Ibm128;
2319 if(
const auto*ET = dyn_cast<EnumType>(CanonicalType))
2326 return!ET->getDecl()->isScoped() && ET->getDecl()->isComplete();
2327 returnisa<ComplexType>(CanonicalType) ||
isBitIntType();
2333 const Type*
T= CanonicalType.getTypePtr();
2334 if(
const auto*BT = dyn_cast<BuiltinType>(
T)) {
2335 if(BT->getKind() == BuiltinType::Bool)
return STK_Bool;
2336 if(BT->getKind() == BuiltinType::NullPtr)
return STK_CPointer;
2340llvm_unreachable(
"unknown scalar builtin type");
2341}
else if(isa<PointerType>(
T)) {
2343}
else if(isa<BlockPointerType>(
T)) {
2345}
else if(isa<ObjCObjectPointerType>(
T)) {
2347}
else if(isa<MemberPointerType>(
T)) {
2349}
else if(isa<EnumType>(
T)) {
2350assert(cast<EnumType>(
T)->getDecl()->isComplete());
2352}
else if(
const auto*CT = dyn_cast<ComplexType>(
T)) {
2353 if(CT->getElementType()->isRealFloatingType())
2360llvm_unreachable(
"unknown scalar type");
2373 if(
const auto*
Record= dyn_cast<RecordType>(CanonicalType)) {
2374 if(
const auto*ClassDecl = dyn_cast<CXXRecordDecl>(
Record->getDecl()))
2375 returnClassDecl->isAggregate();
2380 returnisa<ArrayType>(CanonicalType);
2387assert(!
isIncompleteType() &&
"This doesn't make sense for incomplete types");
2388assert(!
isDependentType() &&
"This doesn't make sense for dependent types");
2390 return!isa<VariableArrayType>(CanonicalType);
2400 switch(CanonicalType->getTypeClass()) {
2401 default:
return false;
2407 EnumDecl*EnumD = cast<EnumType>(CanonicalType)->getDecl();
2415 RecordDecl*Rec = cast<RecordType>(CanonicalType)->getDecl();
2420 caseInjectedClassName: {
2421 CXXRecordDecl*Rec = cast<InjectedClassNameType>(CanonicalType)->getDecl();
2434 returncast<ArrayType>(CanonicalType)->getElementType()
2435->isIncompleteType(Def);
2436 caseIncompleteArray:
2439 caseMemberPointer: {
2443 auto*MPTy = cast<MemberPointerType>(CanonicalType);
2444 const Type*ClassTy = MPTy->getClass();
2457 if(RD->
hasAttr<MSInheritanceAttr>())
2462 returncast<ObjCObjectType>(CanonicalType)->getBaseType()
2463->isIncompleteType(Def);
2464 caseObjCInterface: {
2467= cast<ObjCInterfaceType>(CanonicalType)->getDecl();
2479 if(
const BuiltinType*BT = getAs<BuiltinType>()) {
2480 switch(BT->getKind()) {
2482#define WASM_TYPE(Name, Id, SingletonId) case BuiltinType::Id: 2483#include "clang/Basic/WebAssemblyReferenceTypes.def" 2485#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) case BuiltinType::Id: 2486#include "clang/Basic/HLSLIntangibleTypes.def" 2496 if(
const auto*BT = getAs<BuiltinType>())
2497 returnBT->getKind() == BuiltinType::WasmExternRef;
2502 if(
const auto*ATy = dyn_cast<ArrayType>(
this))
2503 returnATy->getElementType().isWebAssemblyReferenceType();
2505 if(
const auto*PTy = dyn_cast<PointerType>(
this))
2506 returnPTy->getPointeeType().isWebAssemblyReferenceType();
2518 if(
const BuiltinType*BT = getAs<BuiltinType>()) {
2519 switch(BT->getKind()) {
2521#define SVE_VECTOR_TYPE(Name, MangledName, Id, SingletonId) \ 2522 case BuiltinType::Id: \ 2524#define SVE_OPAQUE_TYPE(Name, MangledName, Id, SingletonId) \ 2525 case BuiltinType::Id: \ 2527#define SVE_PREDICATE_TYPE(Name, MangledName, Id, SingletonId) \ 2528 case BuiltinType::Id: \ 2530#define SVE_TYPE(Name, Id, SingletonId) 2531#include "clang/Basic/AArch64SVEACLETypes.def" 2540 if(
const BuiltinType*BT = getAs<BuiltinType>()) {
2541 switch(BT->getKind()) {
2542#define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id: 2543#include "clang/Basic/RISCVVTypes.def" 2553 if(
const BuiltinType*BT = getAs<BuiltinType>()) {
2554 switch(BT->getKind()) {
2555 caseBuiltinType::SveInt8:
2556 caseBuiltinType::SveInt16:
2557 caseBuiltinType::SveInt32:
2558 caseBuiltinType::SveInt64:
2559 caseBuiltinType::SveUint8:
2560 caseBuiltinType::SveUint16:
2561 caseBuiltinType::SveUint32:
2562 caseBuiltinType::SveUint64:
2563 caseBuiltinType::SveFloat16:
2564 caseBuiltinType::SveFloat32:
2565 caseBuiltinType::SveFloat64:
2566 caseBuiltinType::SveBFloat16:
2567 caseBuiltinType::SveBool:
2568 caseBuiltinType::SveBoolx2:
2569 caseBuiltinType::SveBoolx4:
2570 caseBuiltinType::SveMFloat8:
2588llvm_unreachable(
"Unhandled type");
2595 if(BTy->
getKind() == BuiltinType::SveBool)
2605 if(
const BuiltinType*BT = getAs<BuiltinType>()) {
2606 switch(BT->getKind()) {
2607#define RVV_VECTOR_TYPE(Name, Id, SingletonId, NumEls, ElBits, NF, IsSigned, \ 2609 case BuiltinType::Id: \ 2611#define RVV_PREDICATE_TYPE(Name, Id, SingletonId, NumEls) \ 2612 case BuiltinType::Id: \ 2614#include "clang/Basic/RISCVVTypes.def" 2628#define RVV_PREDICATE_TYPE(Name, Id, SingletonId, NumEls) \ 2629 case BuiltinType::Id: \ 2630 return Ctx.UnsignedCharTy; 2633#include "clang/Basic/RISCVVTypes.def" 2636llvm_unreachable(
"Unhandled type");
2654 if((*this)->isIncompleteArrayType())
2657 if((*this)->isIncompleteType())
2666 default:
return false;
2667 caseType::VariableArray:
2668 caseType::ConstantArray:
2672 caseType::ObjCObjectPointer:
2673 caseType::BlockPointer:
2677 caseType::MemberPointer:
2679 caseType::ExtVector:
2687 if(
const auto*ClassDecl =
2688dyn_cast<CXXRecordDecl>(cast<RecordType>(CanonicalType)->getDecl()))
2689 returnClassDecl->isPOD();
2703 if((*this)->isArrayType())
2706 if((*this)->isSizelessBuiltinType())
2711 if((*this)->isIncompleteType())
2730 if(
const auto*ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl())) {
2737 returnClassDecl->hasTrivialDefaultConstructor() &&
2738!ClassDecl->hasNonTrivialDefaultConstructor() &&
2739ClassDecl->isTriviallyCopyable();
2751 boolIsCopyConstructible) {
2752 if(
type->isArrayType())
2754Context, IsCopyConstructible);
2756 if(
type.hasNonTrivialObjCLifetime())
2781 if(
const auto*ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl())) {
2782 if(IsCopyConstructible) {
2783 returnClassDecl->isTriviallyCopyConstructible();
2785 returnClassDecl->isTriviallyCopyable();
2802 if(CanonicalType.hasNonTrivialObjCLifetime())
2804 if(CanonicalType->isArrayType())
2808 if(CanonicalType->isIncompleteType())
2810 const auto*RD = CanonicalType->getAsRecordDecl();
2817 if(RD->mayInsertExtraPadding())
2820 for(
auto*
constField : RD->fields()) {
2821 if(!Field->getType().isBitwiseCloneableType(Context))
2825 if(
const auto*CXXRD = dyn_cast<CXXRecordDecl>(RD)) {
2826 for(
auto Base: CXXRD->bases())
2827 if(!
Base.getType().isBitwiseCloneableType(Context))
2829 for(
autoVBase : CXXRD->vbases())
2830 if(!VBase.getType().isBitwiseCloneableType(Context))
2850 returnRD->canPassInRegisters();
2866 return!Context.
getLangOpts().ObjCAutoRefCount &&
2898 if(
const auto*RT =
2899 getTypePtr()->getBaseElementTypeUnsafe()->getAs<RecordType>())
2900 if(RT->getDecl()->isNonTrivialToPrimitiveDefaultInitialize())
2914 if(
const auto*RT =
2915 getTypePtr()->getBaseElementTypeUnsafe()->getAs<RecordType>())
2916 if(RT->getDecl()->isNonTrivialToPrimitiveCopy())
2952assert(BaseTy &&
"NULL element type");
2982 if(
const auto*ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl()))
2983 returnClassDecl->isLiteral();
2990 returnAT->getValueType()->isLiteralType(Ctx);
3012 returnRD->isStructural();
3025assert(BaseTy &&
"NULL element type");
3035 if(
const auto*ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl()))
3036 if(!ClassDecl->isStandardLayout())
3064assert(BaseTy &&
"NULL element type");
3077 if(
const auto*ClassDecl = dyn_cast<CXXRecordDecl>(RT->getDecl())) {
3080 if(!ClassDecl->isTrivial())
return false;
3085 if(!ClassDecl->isStandardLayout())
return false;
3114 if(
const auto*ET = getAs<EnumType>()) {
3116 if(II && II->
isStr(
"align_val_t") && ET->getDecl()->isInStdNamespace())
3123 if(
const auto*ET = getAs<EnumType>()) {
3125 if(II && II->
isStr(
"byte") && ET->getDecl()->isInStdNamespace())
3141 caseTemplateTypeParm:
3142 caseSubstTemplateTypeParm:
3143 caseTemplateSpecialization:
3146 caseDependentTemplateSpecialization:
3190llvm_unreachable(
"Type specifier is not a tag type kind.");
3207llvm_unreachable(
"Unknown tag type kind.");
3225llvm_unreachable(
"Elaborated type keyword is not a tag type kind.");
3227llvm_unreachable(
"Unknown elaborated type keyword.");
3243llvm_unreachable(
"Unknown elaborated type keyword.");
3257 return "__interface";
3264llvm_unreachable(
"Unknown elaborated type keyword.");
3267DependentTemplateSpecializationType::DependentTemplateSpecializationType(
3274NNS(NNS), Name(Name) {
3277 "DependentTemplateSpecializatonType requires dependent qualifier");
3278 auto*ArgBuffer =
const_cast<TemplateArgument*
>(template_arguments().data());
3281TemplateArgumentDependence::UnexpandedPack));
3294ID.AddInteger(llvm::to_underlying(Keyword));
3295ID.AddPointer(Qualifier);
3296ID.AddPointer(Name);
3298Arg.Profile(ID, Context);
3303 if(
const auto*Elab = dyn_cast<ElaboratedType>(
this))
3304Keyword = Elab->getKeyword();
3305 else if(
const auto*DepName = dyn_cast<DependentNameType>(
this))
3306Keyword = DepName->getKeyword();
3307 else if(
const auto*DepTST =
3308dyn_cast<DependentTemplateSpecializationType>(
this))
3309Keyword = DepTST->getKeyword();
3318#define ABSTRACT_TYPE(Derived, Base) 3319#define TYPE(Derived, Base) case Derived: return #Derived; 3320#include "clang/AST/TypeNodes.inc" 3323llvm_unreachable(
"Invalid type class.");
3331 returnPolicy.
Bool?
"bool":
"_Bool";
3337 return "signed char";
3345 return "long long";
3349 return "unsigned char";
3351 return "unsigned short";
3353 return "unsigned int";
3355 return "unsigned long";
3357 return "unsigned long long";
3359 return "unsigned __int128";
3361 returnPolicy.
Half?
"half":
"__fp16";
3369 return "long double";
3371 return "short _Accum";
3375 return "long _Accum";
3377 return "unsigned short _Accum";
3379 return "unsigned _Accum";
3381 return "unsigned long _Accum";
3382 caseBuiltinType::ShortFract:
3383 return "short _Fract";
3384 caseBuiltinType::Fract:
3386 caseBuiltinType::LongFract:
3387 return "long _Fract";
3388 caseBuiltinType::UShortFract:
3389 return "unsigned short _Fract";
3390 caseBuiltinType::UFract:
3391 return "unsigned _Fract";
3392 caseBuiltinType::ULongFract:
3393 return "unsigned long _Fract";
3394 caseBuiltinType::SatShortAccum:
3395 return "_Sat short _Accum";
3396 caseBuiltinType::SatAccum:
3397 return "_Sat _Accum";
3398 caseBuiltinType::SatLongAccum:
3399 return "_Sat long _Accum";
3400 caseBuiltinType::SatUShortAccum:
3401 return "_Sat unsigned short _Accum";
3402 caseBuiltinType::SatUAccum:
3403 return "_Sat unsigned _Accum";
3404 caseBuiltinType::SatULongAccum:
3405 return "_Sat unsigned long _Accum";
3406 caseBuiltinType::SatShortFract:
3407 return "_Sat short _Fract";
3408 caseBuiltinType::SatFract:
3409 return "_Sat _Fract";
3410 caseBuiltinType::SatLongFract:
3411 return "_Sat long _Fract";
3412 caseBuiltinType::SatUShortFract:
3413 return "_Sat unsigned short _Fract";
3414 caseBuiltinType::SatUFract:
3415 return "_Sat unsigned _Fract";
3416 caseBuiltinType::SatULongFract:
3417 return "_Sat unsigned long _Fract";
3421 return "__float128";
3426 returnPolicy.
MSWChar?
"__wchar_t":
"wchar_t";
3436 return "<overloaded function type>";
3438 return "<bound member function type>";
3439 caseUnresolvedTemplate:
3440 return "<unresolved template type>";
3442 return "<pseudo-object type>";
3444 return "<dependent type>";
3446 return "<unknown type>";
3447 caseARCUnbridgedCast:
3448 return "<ARC unbridged cast type>";
3450 return "<builtin fn type>";
3457#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ 3459 return "__"#Access " " #ImgType "_t";
3460#include "clang/Basic/OpenCLImageTypes.def" 3462 return "sampler_t";
3466 return "clk_event_t";
3470 return "reserve_id_t";
3471 caseIncompleteMatrixIdx:
3472 return "<incomplete matrix index type>";
3474 return "<array section type>";
3475 caseOMPArrayShaping:
3476 return "<OpenMP array shaping type>";
3478 return "<OpenMP iterator type>";
3479#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \ 3482#include "clang/Basic/OpenCLExtensionTypes.def" 3483#define SVE_TYPE(Name, Id, SingletonId) \ 3486#include "clang/Basic/AArch64SVEACLETypes.def" 3487#define PPC_VECTOR_TYPE(Name, Id, Size) \ 3490#include "clang/Basic/PPCTypes.def" 3491#define RVV_TYPE(Name, Id, SingletonId) \ 3494#include "clang/Basic/RISCVVTypes.def" 3495#define WASM_TYPE(Name, Id, SingletonId) \ 3498#include "clang/Basic/WebAssemblyReferenceTypes.def" 3499#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) \ 3502#include "clang/Basic/AMDGPUTypes.def" 3503#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) \ 3506#include "clang/Basic/HLSLIntangibleTypes.def" 3509llvm_unreachable(
"Invalid builtin type.");
3514 if(
auto*PET = dyn_cast<PackExpansionType>(
getTypePtr()))
3515 returnPET->getPattern();
3520 if(
const auto*RefType =
getTypePtr()->getAs<ReferenceType>())
3537 case CC_C:
return "cdecl";
3554 case CC_Swift:
return "swiftcall";
3565llvm_unreachable(
"Invalid calling convention.");
3583assert(
getNumParams() == params.size() &&
"NumParams overflow!");
3591 auto&ExtraBits = *getTrailingObjects<FunctionTypeExtraBitfields>();
3598 auto&ArmTypeAttrs = *getTrailingObjects<FunctionTypeArmAttributes>();
3599ArmTypeAttrs = FunctionTypeArmAttributes();
3602 auto&ExtraBits = *getTrailingObjects<FunctionTypeExtraBitfields>();
3603ExtraBits.HasArmTypeAttributes =
true;
3607 auto*argSlot = getTrailingObjects<QualType>();
3610~TypeDependence::VariablyModified);
3611argSlot[i] = params[i];
3616 auto&ArmTypeAttrs = *getTrailingObjects<FunctionTypeArmAttributes>();
3618 "Not enough bits to encode SME attributes");
3624 auto&ExtraBits = *getTrailingObjects<FunctionTypeExtraBitfields>();
3626assert(NumExceptions <= 1023 &&
"Not enough bits to encode exceptions");
3627ExtraBits.NumExceptionType = NumExceptions;
3629assert(hasExtraBitfields() &&
"missing trailing extra bitfields!");
3631 reinterpret_cast<QualType*
>(getTrailingObjects<ExceptionType>());
3639(TypeDependence::Instantiation | TypeDependence::UnexpandedPack));
3641exnSlot[I++] = ExceptionType;
3655(TypeDependence::Instantiation | TypeDependence::UnexpandedPack));
3661 auto**slot = getTrailingObjects<FunctionDecl *>();
3669 auto**slot = getTrailingObjects<FunctionDecl *>();
3688 auto*extParamInfos = getTrailingObjects<ExtParameterInfo>();
3695*getTrailingObjects<Qualifiers>() = epi.
TypeQuals;
3702 auto&EllipsisLoc = *getTrailingObjects<SourceLocation>();
3707 auto&ExtraBits = *getTrailingObjects<FunctionTypeExtraBitfields>();
3709ExtraBits.NumFunctionEffects = EffectsCount;
3710assert(ExtraBits.NumFunctionEffects == EffectsCount &&
3711 "effect bitfield overflow");
3714 auto*DestFX = getTrailingObjects<FunctionEffect>();
3715std::uninitialized_copy(SrcFX.begin(), SrcFX.end(), DestFX);
3718 if(!SrcConds.empty()) {
3719ExtraBits.EffectsHaveConditions =
true;
3720 auto*DestConds = getTrailingObjects<EffectConditionExpr>();
3721std::uninitialized_copy(SrcConds.begin(), SrcConds.end(), DestConds);
3722assert(std::any_of(SrcConds.begin(), SrcConds.end(),
3724if (const Expr *E = EC.getCondition())
3725return E->isTypeDependent() ||
3726E->isValueDependent();
3729 "expected a dependent expression among the conditions");
3737 returnNE->isValueDependent();
3749 returnNE->isInstantiationDependent();
3760llvm_unreachable(
"should not call this with unresolved exception specs");
3786llvm_unreachable(
"unexpected exception specification kind");
3790 for(
unsignedArgIdx =
getNumParams(); ArgIdx; --ArgIdx)
3791 if(isa<PackExpansionType>(
getParamType(ArgIdx - 1)))
3798 const QualType*ArgTys,
unsignedNumParams,
3799 constExtProtoInfo &epi,
3822ID.AddPointer(
Result.getAsOpaquePtr());
3823 for(
unsignedi = 0; i != NumParams; ++i)
3824ID.AddPointer(ArgTys[i].getAsOpaquePtr());
3828assert(!(
unsigned(epi.Variadic) & ~1) &&
3829!(
unsigned(epi.RefQualifier) & ~3) &&
3830!(
unsigned(epi.ExceptionSpec.Type) & ~15) &&
3831 "Values larger than expected.");
3832ID.AddInteger(
unsigned(epi.Variadic) +
3833(epi.RefQualifier << 1) +
3834(epi.ExceptionSpec.Type << 3));
3835ID.Add(epi.TypeQuals);
3837 for(
QualTypeEx : epi.ExceptionSpec.Exceptions)
3840epi.ExceptionSpec.NoexceptExpr->Profile(ID, Context, Canonical);
3843 ID.AddPointer(epi.ExceptionSpec.SourceDecl->getCanonicalDecl());
3845 if(epi.ExtParameterInfos) {
3846 for(
unsignedi = 0; i != NumParams; ++i)
3847 ID.AddInteger(epi.ExtParameterInfos[i].getOpaqueValue());
3850epi.ExtInfo.Profile(ID);
3852 unsignedEffectCount = epi.FunctionEffects.size();
3853 boolHasConds = !epi.FunctionEffects.Conditions.empty();
3855 ID.AddInteger((EffectCount << 3) | (HasConds << 2) |
3856(epi.AArch64SMEAttributes << 1) | epi.HasTrailingReturn);
3858 for(
unsignedIdx = 0; Idx != EffectCount; ++Idx) {
3859 ID.AddInteger(epi.FunctionEffects.Effects[Idx].toOpaqueInt32());
3861 ID.AddPointer(epi.FunctionEffects.Conditions[Idx].getCondition());
3872:
Data(
D, Deref << DerefShift) {}
3875 returnData.getInt() & DerefMask;
3880 returnData.getOpaqueValue();
3887Data.setFromOpaqueValue(
V);
3892:
Type(TC, Canon, Wrapped->getDependence()), WrappedTy(Wrapped) {}
3894CountAttributedType::CountAttributedType(
3898CountExpr(CountExpr) {
3902 auto*DeclSlot = getTrailingObjects<TypeCoupledDeclRefInfo>();
3904 for(
unsignedi = 0; i != CoupledDecls.size(); ++i)
3905DeclSlot[i] = CoupledDecls[i];
3912assert(!isa<TypedefType>(can) &&
"Invalid canonical type");
3914 if(!typeMatchesDecl())
3915*getTrailingObjects<QualType>() = Underlying;
3920: *getTrailingObjects<QualType>();
3929*getTrailingObjects<QualType>() = Underlying;
3935cast<TypeDecl>(
Found->getTargetDecl())->getTypeForDecl(), 0)
3936: *getTrailingObjects<QualType>();
3945 while(
auto*InnerMQT = dyn_cast<MacroQualifiedType>(Inner)) {
3948Inner = InnerMQT->getModifiedType();
3959? Context.getUnqualifiedArrayType(Can).getAtomicUnqualifiedType()
3962(
E->getType()->getDependence() &
3964TOExpr(
E), Context(Context) {
3965 TypeOfBits.Kind =
static_cast<unsigned>(Kind);
3986ID.AddBoolean(IsUnqual);
3993? Context.getUnqualifiedArrayType(Can).getAtomicUnqualifiedType()
3995 T->getDependence()),
3996TOType(
T), Context(Context) {
3997 TypeOfBits.Kind =
static_cast<unsigned>(Kind);
4011:
Type(Decltype, can,
4015(
E->getType()->getDependence() &
4017 E(
E), UnderlyingType(underlyingType) {}
4038 Expr*IndexExpr,
boolFullySubstituted,
4040:
Type(PackIndexing, Canonical,
4042Context(Context), Pattern(Pattern), IndexExpr(IndexExpr),
4043Size(Expansions.size()), FullySubstituted(FullySubstituted) {
4045std::uninitialized_copy(Expansions.begin(), Expansions.end(),
4046getTrailingObjects<QualType>());
4051 returnstd::nullopt;
4055 returnstd::nullopt;
4057assert(Index.isNonNegative() &&
"Invalid index");
4058 return static_cast<unsigned>(Index.getExtValue());
4062PackIndexingType::computeDependence(
QualTypePattern,
Expr*IndexExpr,
4067? TypeDependence::DependentInstantiation
4068: TypeDependence::None);
4069 if(Expansions.empty())
4070TD |= Pattern->
getDependence() & TypeDependence::DependentInstantiation;
4075 if(!(IndexD & TypeDependence::UnexpandedPack))
4076TD &= ~TypeDependence::UnexpandedPack;
4081TD |= TypeDependence::Error | TypeDependence::DependentInstantiation;
4088 Expr*
E,
boolFullySubstituted) {
4091ID.AddBoolean(FullySubstituted);
4097:
Type(UnaryTransform, CanonicalType, BaseType->getDependence()),
4098BaseType(BaseType), UnderlyingType(UnderlyingType), UKind(UKind) {}
4112 for(
auto*I :
decl->redecls()) {
4113 if(I->isCompleteDefinition() || I->isBeingDefined())
4129std::vector<const RecordType*> RecordTypeList;
4130RecordTypeList.push_back(
this);
4131 unsignedNextToCheckIndex = 0;
4133 while(RecordTypeList.size() > NextToCheckIndex) {
4135RecordTypeList[NextToCheckIndex]->
getDecl()->fields()) {
4141 if(!llvm::is_contained(RecordTypeList, FieldRecTy))
4142RecordTypeList.push_back(FieldRecTy);
4150AttributedType::AttributedType(
QualTypecanon,
const Attr*attr,
4157:
Type(Attributed, canon, equivalent->getDependence()), Attribute(
attr),
4158ModifiedType(modified), EquivalentType(equivalent) {
4160assert(!attr ||
attr->getKind() == attrKind);
4170 caseattr::ObjCOwnership:
4171 caseattr::ObjCInertUnsafeUnretained:
4172 caseattr::TypeNonNull:
4173 caseattr::TypeNullable:
4174 caseattr::TypeNullableResult:
4175 caseattr::TypeNullUnspecified:
4176 caseattr::LifetimeBound:
4177 caseattr::AddressSpace:
4190 default:
return false;
4197llvm_unreachable(
"invalid attr kind");
4201 return getAttrKind() == attr::WebAssemblyFuncref;
4207 default:
return false;
4210 caseattr::FastCall:
4212 caseattr::ThisCall:
4214 caseattr::SwiftCall:
4215 caseattr::SwiftAsyncCall:
4216 caseattr::VectorCall:
4217 caseattr::AArch64VectorPcs:
4218 caseattr::AArch64SVEPcs:
4219 caseattr::AMDGPUKernelCall:
4223 caseattr::IntelOclBicc:
4224 caseattr::PreserveMost:
4225 caseattr::PreserveAll:
4227 caseattr::PreserveNone:
4228 caseattr::RISCVVectorCC:
4231llvm_unreachable(
"invalid attr kind");
4244 if(
const auto*TTP = dyn_cast<TemplateTypeParmDecl>(
D))
4246 returncast<TemplateTypeParmDecl>(
4250SubstTemplateTypeParmType::SubstTemplateTypeParmType(
4251 QualTypeReplacement,
Decl*AssociatedDecl,
unsignedIndex,
4253:
Type(SubstTemplateTypeParm, Replacement.getCanonicalType(),
4254Replacement->getDependence()),
4255AssociatedDecl(AssociatedDecl) {
4256SubstTemplateTypeParmTypeBits.HasNonCanonicalUnderlyingType =
4257Replacement != getCanonicalTypeInternal();
4258 if(SubstTemplateTypeParmTypeBits.HasNonCanonicalUnderlyingType)
4259*getTrailingObjects<QualType>() = Replacement;
4261SubstTemplateTypeParmTypeBits.Index = Index;
4262SubstTemplateTypeParmTypeBits.PackIndex = PackIndex ? *PackIndex + 1 : 0;
4263SubstTemplateTypeParmTypeBits.SubstitutionFlag = llvm::to_underlying(Flag);
4264assert((Flag != SubstTemplateTypeParmTypeFlag::ExpandPacksInPlace ||
4266 "ExpandPacksInPlace needs a valid PackIndex");
4267assert(AssociatedDecl !=
nullptr);
4275SubstTemplateTypeParmPackType::SubstTemplateTypeParmPackType(
4276 QualTypeCanon,
Decl*AssociatedDecl,
unsignedIndex,
boolFinal,
4278:
Type(SubstTemplateTypeParmPack, Canon,
4281Arguments(ArgPack.pack_begin()),
4282AssociatedDeclAndFinal(AssociatedDecl, Final) {
4285assert(AssociatedDecl !=
nullptr);
4289 returnAssociatedDeclAndFinal.getPointer();
4293 returnAssociatedDeclAndFinal.getInt();
4314 const Decl*AssociatedDecl,
4315 unsignedIndex,
boolFinal,
4317ID.AddPointer(AssociatedDecl);
4318ID.AddInteger(Index);
4319ID.AddBoolean(Final);
4322ID.AddPointer(
P.getAsType().getAsOpaquePtr());
4333 if(Arg.isDependent())
4341 if(ArgLoc.getArgument().isInstantiationDependent())
4347TemplateSpecializationType::TemplateSpecializationType(
4350:
Type(TemplateSpecialization, Canon.isNull() ?
QualType(this, 0) : Canon,
4360assert(!
T.getAsDependentTemplateName() &&
4361 "Use DependentTemplateSpecializationType for dependent template-name");
4368 "Unexpected template name for TemplateSpecializationType");
4381~TypeDependence::Dependent);
4384TypeDependence::VariablyModified);
4391*
reinterpret_cast<QualType*
>(
Begin+ Args.size()) = AliasedType;
4396assert(
isTypeAlias() &&
"not a type alias template specialization");
4414Arg.Profile(ID, Context);
4439ID.AddInteger(typeArgs.size());
4440 for(
autotypeArg : typeArgs)
4441ID.AddPointer(typeArg.getAsOpaquePtr());
4442ID.AddInteger(protocols.size());
4443 for(
auto*proto : protocols)
4444ID.AddPointer(proto);
4445ID.AddBoolean(isKindOf);
4458ID.AddPointer(OTPDecl);
4460ID.AddInteger(protocols.size());
4461 for(
auto*proto : protocols)
4462ID.AddPointer(proto);
4473classCachedProperties {
4478CachedProperties(
LinkageL,
boollocal) : L(L), local(local) {}
4480 LinkagegetLinkage()
const{
returnL; }
4481 boolhasLocalOrUnnamedType()
const{
returnlocal; }
4483 friendCachedProperties merge(CachedProperties L, CachedProperties R) {
4485 returnCachedProperties(MergedLinkage, L.hasLocalOrUnnamedType() ||
4486R.hasLocalOrUnnamedType());
4502 return get(
T.getTypePtr());
4507 returnCachedProperties(
T->
TypeBits.getLinkage(),
4508 T->
TypeBits.hasLocalOrUnnamedType());
4513 if(
T->
TypeBits.isCacheValid())
return;
4529 T->
TypeBits.CachedLinkage = llvm::to_underlying(
Result.getLinkage());
4530 T->
TypeBits.CachedLocalOrUnnamed =
Result.hasLocalOrUnnamedType();
4549#define TYPE(Class,Base) 4550#define NON_CANONICAL_TYPE(Class,Base) case Type::Class: 4551#include "clang/AST/TypeNodes.inc" 4552llvm_unreachable(
"didn't expect a non-canonical type here");
4554#define TYPE(Class,Base) 4555#define DEPENDENT_TYPE(Class,Base) case Type::Class: 4556#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class,Base) case Type::Class: 4557#include "clang/AST/TypeNodes.inc" 4563 caseType::DeducedTemplateSpecialization:
4577 const TagDecl*Tag = cast<TagType>(
T)->getDecl();
4583 LinkageL = Tag->getLinkageInternal();
4584 boolIsLocalOrUnnamed =
4585Tag->getDeclContext()->isFunctionOrMethod() ||
4586!Tag->hasNameForLinkage();
4587 returnCachedProperties(L, IsLocalOrUnnamed);
4594 return Cache::get(cast<ComplexType>(
T)->getElementType());
4597 caseType::BlockPointer:
4599 caseType::LValueReference:
4600 caseType::RValueReference:
4602 caseType::MemberPointer: {
4603 const auto*MPT = cast<MemberPointerType>(
T);
4607 caseType::ConstantArray:
4608 caseType::IncompleteArray:
4609 caseType::VariableArray:
4610 caseType::ArrayParameter:
4611 return Cache::get(cast<ArrayType>(
T)->getElementType());
4613 caseType::ExtVector:
4614 return Cache::get(cast<VectorType>(
T)->getElementType());
4615 caseType::ConstantMatrix:
4616 return Cache::get(cast<ConstantMatrixType>(
T)->getElementType());
4617 caseType::FunctionNoProto:
4618 return Cache::get(cast<FunctionType>(
T)->getReturnType());
4619 caseType::FunctionProto: {
4620 const auto*FPT = cast<FunctionProtoType>(
T);
4621CachedProperties result =
Cache::get(FPT->getReturnType());
4622 for(
const auto&ai : FPT->param_types())
4626 caseType::ObjCInterface: {
4627 LinkageL = cast<ObjCInterfaceType>(
T)->getDecl()->getLinkageInternal();
4628 returnCachedProperties(L,
false);
4630 caseType::ObjCObject:
4631 return Cache::get(cast<ObjCObjectType>(
T)->getBaseType());
4632 caseType::ObjCObjectPointer:
4635 return Cache::get(cast<AtomicType>(
T)->getValueType());
4637 return Cache::get(cast<PipeType>(
T)->getElementType());
4638 caseType::HLSLAttributedResource:
4639 return Cache::get(cast<HLSLAttributedResourceType>(
T)->getWrappedType());
4642llvm_unreachable(
"unhandled type class");
4653 return TypeBits.hasLocalOrUnnamedType();
4658#define TYPE(Class,Base) 4659#define NON_CANONICAL_TYPE(Class,Base) case Type::Class: 4660#include "clang/AST/TypeNodes.inc" 4661llvm_unreachable(
"didn't expect a non-canonical type here");
4663#define TYPE(Class,Base) 4664#define DEPENDENT_TYPE(Class,Base) case Type::Class: 4665#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class,Base) case Type::Class: 4666#include "clang/AST/TypeNodes.inc" 4676 caseType::DeducedTemplateSpecialization:
4687 caseType::BlockPointer:
4689 caseType::LValueReference:
4690 caseType::RValueReference:
4692 caseType::MemberPointer: {
4693 const auto*MPT = cast<MemberPointerType>(
T);
4698 caseType::ConstantArray:
4699 caseType::IncompleteArray:
4700 caseType::VariableArray:
4701 caseType::ArrayParameter:
4704 caseType::ExtVector:
4706 caseType::ConstantMatrix:
4708cast<ConstantMatrixType>(
T)->getElementType());
4709 caseType::FunctionNoProto:
4711 caseType::FunctionProto: {
4712 const auto*FPT = cast<FunctionProtoType>(
T);
4714 for(
const auto&ai : FPT->param_types())
4718 caseType::ObjCInterface:
4720 caseType::ObjCObject:
4722 caseType::ObjCObjectPointer:
4729 caseType::HLSLAttributedResource:
4731->getContainedType()
4732->getCanonicalTypeInternal());
4735llvm_unreachable(
"unhandled type class");
4745 returnL ==
TypeBits.getLinkage();
4766 if(
autoNullability = AT->getImmediateNullability())
4769 Type= AT->getEquivalentType();
4771 returnstd::nullopt;
4777 switch(
type->getTypeClass()) {
4779#define NON_CANONICAL_TYPE(Class, Parent) \ 4781 llvm_unreachable("non-canonical type");
4782#define TYPE(Class, Parent) 4783#include "clang/AST/TypeNodes.inc" 4787 caseType::BlockPointer:
4788 caseType::MemberPointer:
4789 caseType::ObjCObjectPointer:
4793 caseType::UnresolvedUsing:
4794 caseType::TypeOfExpr:
4796 caseType::Decltype:
4797 caseType::PackIndexing:
4798 caseType::UnaryTransform:
4799 caseType::TemplateTypeParm:
4800 caseType::SubstTemplateTypeParmPack:
4801 caseType::DependentName:
4802 caseType::DependentTemplateSpecialization:
4804 returnResultIfUnknown;
4807 caseType::TemplateSpecialization:
4810cast<TemplateSpecializationType>(
type.getTypePtr())
4812.getAsTemplateDecl())
4813 if(
auto*CTD = dyn_cast<ClassTemplateDecl>(templateDecl))
4814 returnllvm::any_of(
4816return RTD->getTemplatedDecl()->hasAttr<TypeNullableAttr>();
4818 returnResultIfUnknown;
4821 switch(cast<BuiltinType>(
type.getTypePtr())->getKind()) {
4823#define SIGNED_TYPE(Id, SingletonId) case BuiltinType::Id: 4824#define UNSIGNED_TYPE(Id, SingletonId) case BuiltinType::Id: 4825#define FLOATING_TYPE(Id, SingletonId) case BuiltinType::Id: 4826#define BUILTIN_TYPE(Id, SingletonId) 4827#include "clang/AST/BuiltinTypes.def" 4830 caseBuiltinType::UnresolvedTemplate:
4832 caseBuiltinType::Dependent:
4833 caseBuiltinType::Overload:
4834 caseBuiltinType::BoundMember:
4835 caseBuiltinType::PseudoObject:
4836 caseBuiltinType::UnknownAny:
4837 caseBuiltinType::ARCUnbridgedCast:
4838 returnResultIfUnknown;
4840 caseBuiltinType::Void:
4841 caseBuiltinType::ObjCId:
4842 caseBuiltinType::ObjCClass:
4843 caseBuiltinType::ObjCSel:
4844#define IMAGE_TYPE(ImgType, Id, SingletonId, Access, Suffix) \ 4845 case BuiltinType::Id: 4846#include "clang/Basic/OpenCLImageTypes.def" 4847#define EXT_OPAQUE_TYPE(ExtType, Id, Ext) \ 4848 case BuiltinType::Id: 4849#include "clang/Basic/OpenCLExtensionTypes.def" 4850 caseBuiltinType::OCLSampler:
4851 caseBuiltinType::OCLEvent:
4852 caseBuiltinType::OCLClkEvent:
4853 caseBuiltinType::OCLQueue:
4854 caseBuiltinType::OCLReserveID:
4855#define SVE_TYPE(Name, Id, SingletonId) \ 4856 case BuiltinType::Id: 4857#include "clang/Basic/AArch64SVEACLETypes.def" 4858#define PPC_VECTOR_TYPE(Name, Id, Size) \ 4859 case BuiltinType::Id: 4860#include "clang/Basic/PPCTypes.def" 4861#define RVV_TYPE(Name, Id, SingletonId) case BuiltinType::Id: 4862#include "clang/Basic/RISCVVTypes.def" 4863#define WASM_TYPE(Name, Id, SingletonId) case BuiltinType::Id: 4864#include "clang/Basic/WebAssemblyReferenceTypes.def" 4865#define AMDGPU_TYPE(Name, Id, SingletonId, Width, Align) case BuiltinType::Id: 4866#include "clang/Basic/AMDGPUTypes.def" 4867#define HLSL_INTANGIBLE_TYPE(Name, Id, SingletonId) case BuiltinType::Id: 4868#include "clang/Basic/HLSLIntangibleTypes.def" 4869 caseBuiltinType::BuiltinFn:
4870 caseBuiltinType::NullPtr:
4871 caseBuiltinType::IncompleteMatrixIdx:
4872 caseBuiltinType::ArraySection:
4873 caseBuiltinType::OMPArrayShaping:
4874 caseBuiltinType::OMPIterator:
4877llvm_unreachable(
"unknown builtin type");
4879 caseType::Record: {
4883 if(
const auto*CTSD = dyn_cast<ClassTemplateSpecializationDecl>(RD))
4884 returnllvm::any_of(
4885CTSD->getSpecializedTemplate()->redecls(),
4887return RTD->getTemplatedDecl()->hasAttr<TypeNullableAttr>();
4890return RD->hasAttr<TypeNullableAttr>();
4896 caseType::LValueReference:
4897 caseType::RValueReference:
4898 caseType::ConstantArray:
4899 caseType::IncompleteArray:
4900 caseType::VariableArray:
4901 caseType::DependentSizedArray:
4902 caseType::DependentVector:
4903 caseType::DependentSizedExtVector:
4905 caseType::ExtVector:
4906 caseType::ConstantMatrix:
4907 caseType::DependentSizedMatrix:
4908 caseType::DependentAddressSpace:
4909 caseType::FunctionProto:
4910 caseType::FunctionNoProto:
4911 caseType::DeducedTemplateSpecialization:
4913 caseType::InjectedClassName:
4914 caseType::PackExpansion:
4915 caseType::ObjCObject:
4916 caseType::ObjCInterface:
4920 caseType::DependentBitInt:
4921 caseType::ArrayParameter:
4922 caseType::HLSLAttributedResource:
4925llvm_unreachable(
"bad type kind!");
4937 returnstd::nullopt;
4940std::optional<NullabilityKind>
4943 if(
autoMacroTy = dyn_cast<MacroQualifiedType>(
T))
4944AttrTy = MacroTy->getUnderlyingType();
4946 if(
autoattributed = dyn_cast<AttributedType>(AttrTy)) {
4947 if(
autonullability = attributed->getImmediateNullability()) {
4948 T= attributed->getModifiedType();
4953 returnstd::nullopt;
4957 const auto*objcPtr = getAs<ObjCObjectPointerType>();
4961 if(objcPtr->isObjCIdType()) {
4972}
else if(objcPtr->isObjCQualifiedIdType()) {
4997 "cannot query implicit lifetime for non-inferrable type");
5002 while(
const auto*array = dyn_cast<ArrayType>(canon))
5003canon = array->getElementType().getTypePtr();
5005 if(
const auto*opt = dyn_cast<ObjCObjectPointerType>(canon)) {
5007 if(opt->getObjectType()->isObjCClass())
5015 if(
const auto*
typedefType= getAs<TypedefType>())
5016 return typedefType->getDecl()->hasAttr<ObjCNSObjectAttr>();
5021 if(
const auto*
typedefType= getAs<TypedefType>())
5022 return typedefType->getDecl()->hasAttr<ObjCIndependentClassAttr>();
5035 if(
const auto*OPT = getAs<PointerType>())
5036 returnOPT->getPointeeType()->isObjCIndirectLifetimeType();
5037 if(
const auto*Ref = getAs<ReferenceType>())
5038 returnRef->getPointeeType()->isObjCIndirectLifetimeType();
5039 if(
const auto*MemPtr = getAs<MemberPointerType>())
5040 returnMemPtr->getPointeeType()->isObjCIndirectLifetimeType();
5048 while(
const ArrayType*array =
type->getAsArrayTypeUnsafe())
5049 type= array->getElementType().getTypePtr();
5050 return type->isObjCRetainableType();
5061 const auto*
Pointer= getAs<PointerType>();
5071 if(
const auto*RT = getAs<RecordType>())
5072 returnRT->getDecl()->hasAttr<CUDADeviceBuiltinSurfaceTypeAttr>();
5078 if(
const auto*RT = getAs<RecordType>())
5079 returnRT->getDecl()->hasAttr<CUDADeviceBuiltinTextureTypeAttr>();
5086 if(
const auto*ptr = getAs<PointerType>())
5087 returnptr->getPointeeType()->hasSizedVLAType();
5088 if(
const auto*ref = getAs<ReferenceType>())
5089 returnref->getPointeeType()->hasSizedVLAType();
5091 if(isa<VariableArrayType>(arr) &&
5092cast<VariableArrayType>(arr)->getSizeExpr())
5095 returnarr->getElementType()->hasSizedVLAType();
5109 while(isa<ConstantArrayType>(Ty))
5118assert(RD !=
nullptr&&
5119 "all HLSL structs and classes should be CXXRecordDecl");
5125 switch(
type.getObjCLifetime()) {
5137 if(
const auto*RT =
5140 if(
const auto*CXXRD = dyn_cast<CXXRecordDecl>(RD)) {
5142 if(CXXRD->hasDefinition() && !CXXRD->hasTrivialDestructor())
5160llvm::APSInt Val,
unsignedScale) {
5161llvm::FixedPointSemantics FXSema(Val.getBitWidth(), Scale, Val.isSigned(),
5164llvm::APFixedPoint(Val, FXSema).toString(Str);
5172AutoTypeBits.Keyword = llvm::to_underlying(Keyword);
5173AutoTypeBits.NumArgs = TypeConstraintArgs.size();
5174this->TypeConstraintConcept = TypeConstraintConcept;
5175assert(TypeConstraintConcept || AutoTypeBits.NumArgs == 0);
5176 if(TypeConstraintConcept) {
5195ID.AddInteger((
unsigned)Keyword);
5196ID.AddBoolean(IsDependent);
5199Arg.Profile(ID, Context);
5218llvm_unreachable(
"unknown effect kind");
5224 return "nonblocking";
5226 return "nonallocating";
5230 return "allocating";
5232llvm_unreachable(
"unknown effect kind");
5248 returnstd::nullopt;
5253assert(0 &&
"effectProhibitingInference with non-inferable effect kind");
5256llvm_unreachable(
"unknown effect kind");
5266 const KindEK = Effect.kind();
5268 if(EK == CallerKind ||
5279llvm_unreachable(
"unknown effect kind");
5291 unsignedInsertIdx = Effects.size();
5305 if(EC.
Effect.
kind() == NewOppositeKind) {
5306Errs.push_back({EC, NewEC});
5317 if(NewCondition || !Conditions.empty()) {
5318 if(Conditions.empty() && !Effects.empty())
5319Conditions.resize(Effects.size());
5320Conditions.insert(Conditions.begin() + InsertIdx,
5323Effects.insert(Effects.begin() + InsertIdx, NewEC.
Effect);
5328 for(
const auto&Item :
Set)
5330 returnErrs.empty();
5341 autoIterA = LHS.
begin(), EndA = LHS.
end();
5342 autoIterB = RHS.
begin(), EndB = RHS.
end();
5346 returnstd::tuple(LHS.Effect,
uintptr_t(LHS.Cond.getCondition())) <
5347std::tuple(RHS.Effect,
uintptr_t(RHS.Cond.getCondition()));
5350 while(IterA != EndA && IterB != EndB) {
5355 else if(FEWCLess(B, A))
5366assert(Errs.empty() &&
"conflict shouldn't be possible in getIntersection");
5379Combined.
insert(RHS, Errs);
5400llvm::interleaveComma(*
this, OS);
5410llvm::interleaveComma(*
this, OS);
5417assert(std::is_sorted(FX.begin(), FX.end()) &&
"effects should be sorted");
5418assert((Conds.empty() || Conds.size() == FX.size()) &&
5419 "effects size should match conditions size");
5436 if(!RD->
fields().empty()) {
5437 const auto&FirstFD = RD->
fields().begin();
5438 returndyn_cast<HLSLAttributedResourceType>(
5439FirstFD->getType().getTypePtr());
Defines the clang::ASTContext interface.
Provides definitions for the various language-specific address spaces.
static Decl::Kind getKind(const Decl *D)
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
Defines the C++ template declaration subclasses.
Defines the ExceptionSpecificationType enumeration and various utility functions.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::LangOptions interface.
llvm::MachO::Record Record
static bool isRecordType(QualType T)
Defines various enumerations that describe declaration and type specifiers.
static QualType getPointeeType(const MemRegion *R)
Defines the TargetCXXABI class, which abstracts details of the C++ ABI that we're targeting.
static TagDecl * getInterestingTagDecl(TagDecl *decl)
#define SUGARED_TYPE_CLASS(Class)
static const TemplateTypeParmDecl * getReplacedParameter(Decl *D, unsigned Index)
static bool isTriviallyCopyableTypeImpl(const QualType &type, const ASTContext &Context, bool IsCopyConstructible)
static const T * getAsSugar(const Type *Cur)
This will check for a T (which should be a Type which can act as sugar, such as a TypedefType) by rem...
#define TRIVIAL_TYPE_CLASS(Class)
static CachedProperties computeCachedProperties(const Type *T)
C Language Family Type Representation.
Defines the clang::Visibility enumeration and various utility functions.
__DEVICE__ void * memcpy(void *__a, const void *__b, size_t __c)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
BuiltinVectorTypeInfo getBuiltinVectorTypeInfo(const BuiltinType *VecTy) const
Returns the element type, element count and number of vectors (in case of tuple) for a builtin vector...
QualType getAtomicType(QualType T) const
Return the uniqued reference to the atomic type for the specified type.
QualType getParenType(QualType NamedType) const
QualType getRValueReferenceType(QualType T) const
Return the uniqued reference to the type for an rvalue reference to the specified type.
QualType getAutoType(QualType DeducedType, AutoTypeKeyword Keyword, bool IsDependent, bool IsPack=false, ConceptDecl *TypeConstraintConcept=nullptr, ArrayRef< TemplateArgument > TypeConstraintArgs={}) const
C++11 deduced auto type.
QualType getObjCInterfaceType(const ObjCInterfaceDecl *Decl, ObjCInterfaceDecl *PrevDecl=nullptr) const
getObjCInterfaceType - Return the unique reference to the type for the specified ObjC interface decl.
QualType getBlockPointerType(QualType T) const
Return the uniqued reference to the type for a block of the specified type.
QualType getMemberPointerType(QualType T, const Type *Cls) const
Return the uniqued reference to the type for a member pointer to the specified type in the specified ...
QualType getAttributedType(attr::Kind attrKind, QualType modifiedType, QualType equivalentType, const Attr *attr=nullptr) const
QualType getVariableArrayType(QualType EltTy, Expr *NumElts, ArraySizeModifier ASM, unsigned IndexTypeQuals, SourceRange Brackets) const
Return a non-unique reference to the type for a variable array of the specified element type.
QualType getFunctionNoProtoType(QualType ResultTy, const FunctionType::ExtInfo &Info) const
Return a K&R style C function type like 'int()'.
QualType getArrayParameterType(QualType Ty) const
Return the uniqued reference to a specified array parameter type from the original array type.
QualType getVectorType(QualType VectorType, unsigned NumElts, VectorKind VecKind) const
Return the unique reference to a vector type of the specified element type and size.
QualType getSubstTemplateTypeParmType(QualType Replacement, Decl *AssociatedDecl, unsigned Index, std::optional< unsigned > PackIndex, SubstTemplateTypeParmTypeFlag Flag=SubstTemplateTypeParmTypeFlag::None) const
Retrieve a substitution-result type.
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
QualType getLValueReferenceType(QualType T, bool SpelledAsLValue=true) const
Return the uniqued reference to the type for an lvalue reference to the specified type.
QualType getConstantArrayType(QualType EltTy, const llvm::APInt &ArySize, const Expr *SizeExpr, ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return the unique reference to the type for a constant array of the specified element type.
const LangOptions & getLangOpts() const
QualType applyObjCProtocolQualifiers(QualType type, ArrayRef< ObjCProtocolDecl * > protocols, bool &hasError, bool allowOnPointerType=false) const
Apply Objective-C protocol qualifiers to the given type.
QualType getDecayedType(QualType T) const
Return the uniqued reference to the decayed version of the given type.
QualType getBaseElementType(const ArrayType *VAT) const
Return the innermost element type of an array type.
CanQualType ObjCBuiltinIdTy
IdentifierInfo * getNSObjectName() const
Retrieve the identifier 'NSObject'.
CanQualType getSizeType() const
Return the unique type for "size_t" (C99 7.17), defined in <stddef.h>.
QualType getAdjustedType(QualType Orig, QualType New) const
Return the uniqued reference to a type adjusted from the original type to a new type.
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
QualType getObjCObjectPointerType(QualType OIT) const
Return a ObjCObjectPointerType type for the given ObjCObjectType.
QualType getObjCObjectType(QualType Base, ObjCProtocolDecl *const *Protocols, unsigned NumProtocols) const
Legacy interface: cannot provide type arguments or __kindof.
const ArrayType * getAsArrayType(QualType T) const
Type Query functions.
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
CanQualType UnsignedCharTy
QualType getFunctionType(QualType ResultTy, ArrayRef< QualType > Args, const FunctionProtoType::ExtProtoInfo &EPI) const
Return a normal function type with a typed argument list.
QualType getComplexType(QualType T) const
Return the uniqued reference to the type for a complex number with the specified element type.
QualType getExtVectorType(QualType VectorType, unsigned NumElts) const
Return the unique reference to an extended vector type of the specified element type and size.
const TargetInfo & getTargetInfo() const
QualType getIncompleteArrayType(QualType EltTy, ArraySizeModifier ASM, unsigned IndexTypeQuals) const
Return a unique reference to the type for an incomplete array of the specified element type.
QualType getUnqualifiedArrayType(QualType T, Qualifiers &Quals) const
Return this type as a completely-unqualified array type, capturing the qualifiers in Quals.
QualType getConstantMatrixType(QualType ElementType, unsigned NumRows, unsigned NumColumns) const
Return the unique reference to the matrix type of the specified element type and size.
IdentifierInfo * getNSCopyingName()
Retrieve the identifier 'NSCopying'.
Represents a type which was implicitly adjusted by the semantic engine for arbitrary reasons.
Represents a constant array type that does not decay to a pointer when used as a function parameter.
QualType getConstantArrayType(const ASTContext &Ctx) const
Represents an array type, per C99 6.7.5.2 - Array Declarators.
ArraySizeModifier getSizeModifier() const
Qualifiers getIndexTypeQualifiers() const
QualType getElementType() const
ArrayType(TypeClass tc, QualType et, QualType can, ArraySizeModifier sm, unsigned tq, const Expr *sz=nullptr)
Attr - This represents one attribute.
An attributed type is a type to which a type attribute has been applied.
bool isCallingConv() const
std::optional< NullabilityKind > getImmediateNullability() const
static std::optional< NullabilityKind > stripOuterNullability(QualType &T)
Strip off the top-level nullability annotation on the given type, if it's there.
bool isMSTypeSpec() const
bool isWebAssemblyFuncrefSpec() const
bool isQualifier() const
Does this attribute behave like a type qualifier?
Represents a C++11 auto or C++14 decltype(auto) type, possibly constrained by a type-constraint.
ArrayRef< TemplateArgument > getTypeConstraintArguments() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
ConceptDecl * getTypeConstraintConcept() const
AutoTypeKeyword getKeyword() const
BitIntType(bool isUnsigned, unsigned NumBits)
[BoundsSafety] Represents a parent type class for CountAttributedType and similar sugar types that wi...
BoundsAttributedType(TypeClass TC, QualType Wrapped, QualType Canon)
decl_range dependent_decls() const
bool referencesFieldDecls() const
ArrayRef< TypeCoupledDeclRefInfo > Decls
This class is used for builtin types like 'int'.
StringRef getName(const PrintingPolicy &Policy) const
Represents a C++ struct/union/class.
bool isHLSLIntangible() const
Returns true if the class contains HLSL intangible type, either as a field or in base class.
bool mayBeNonDynamicClass() const
CXXRecordDecl * getMostRecentNonInjectedDecl()
bool mayBeDynamicClass() const
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
Complex values, per C99 6.2.5p11.
Declaration of a C++20 concept.
Represents the canonical version of C arrays with a specified constant size.
static unsigned getNumAddressingBits(const ASTContext &Context, QualType ElementType, const llvm::APInt &NumElements)
Determine the number of bits required to address a member of.
static unsigned getMaxSizeBits(const ASTContext &Context)
Determine the maximum number of active bits that an array's size can require, which limits the maximu...
const Expr * getSizeExpr() const
Return a pointer to the size expression.
llvm::APInt getSize() const
Return the constant array size as an APInt.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
ConstantExpr - An expression that occurs in a constant context and optionally the result of evaluatin...
llvm::APSInt getResultAsAPSInt() const
Represents a concrete matrix type with constant number of rows and columns.
ConstantMatrixType(QualType MatrixElementType, unsigned NRows, unsigned NColumns, QualType CanonElementType)
Represents a sugar type with __counted_by or __sized_by annotations, including their _or_null variant...
void Profile(llvm::FoldingSetNodeID &ID)
Represents a pointer type decayed from an array or function type.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
ASTContext & getParentASTContext() const
Decl - This represents one declaration (or definition), e.g.
bool isInStdNamespace() const
ASTContext & getASTContext() const LLVM_READONLY
virtual Decl * getCanonicalDecl()
Retrieves the "canonical" declaration of the given declaration.
Represents the type decltype(expr) (C++11).
QualType desugar() const
Remove a single level of sugar.
bool isSugared() const
Returns whether this type directly provides sugar.
DecltypeType(Expr *E, QualType underlyingType, QualType can=QualType())
QualType getUnderlyingType() const
Common base class for placeholders for types that get replaced by placeholder type deduction: C++11 a...
QualType getDeducedType() const
Get the type deduced for this placeholder type, or null if it has not been deduced.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
Expr * getNumBitsExpr() const
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
DependentBitIntType(bool IsUnsigned, Expr *NumBits)
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
DependentDecltypeType(Expr *E, QualType UnderlyingTpe)
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
Represents an extended vector type where either the type or size is dependent.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
Represents a matrix type where the type and the number of rows and columns is dependent on a template...
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
DependentUnaryTransformType(const ASTContext &C, QualType BaseType, UTTKind UKind)
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context)
Wrap a function effect's condition expression in another struct so that FunctionProtoType's TrailingO...
Expr * getCondition() const
Represents a type that was referred to using an elaborated type keyword, e.g., struct S,...
bool isComplete() const
Returns true if this can be considered a complete type.
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of enums.
This represents one expression.
bool isValueDependent() const
Determines whether the value of this expression depends on.
bool isTypeDependent() const
Determines whether the type of this expression depends on.
bool isInstantiationDependent() const
Whether this expression is instantiation-dependent, meaning that it depends in some way on.
ExprDependence getDependence() const
ExtVectorType - Extended vector type.
Represents a member of a struct/union/class.
A mutable set of FunctionEffect::Kind.
void dump(llvm::raw_ostream &OS) const
A mutable set of FunctionEffects and possibly conditions attached to them.
FunctionEffectSet()=default
bool insert(const FunctionEffectWithCondition &NewEC, Conflicts &Errs)
static FunctionEffectSet getIntersection(FunctionEffectsRef LHS, FunctionEffectsRef RHS)
void dump(llvm::raw_ostream &OS) const
static FunctionEffectSet getUnion(FunctionEffectsRef LHS, FunctionEffectsRef RHS, Conflicts &Errs)
Represents an abstract function effect, using just an enumeration describing its kind.
Kind kind() const
The kind of the effect.
Kind
Identifies the particular effect.
bool shouldDiagnoseFunctionCall(bool Direct, FunctionEffectKindSet CalleeFX) const
StringRef name() const
The description printed in diagnostics, e.g. 'nonblocking'.
Kind oppositeKind() const
Return the opposite kind, for effects which have opposites.
std::optional< FunctionEffect > effectProhibitingInference(const Decl &Callee, FunctionEffectKindSet CalleeFX) const
Determine whether the effect is allowed to be inferred on the callee, which is either a FunctionDecl ...
An immutable set of FunctionEffects and possibly conditions attached to them.
void dump(llvm::raw_ostream &OS) const
ArrayRef< FunctionEffect > effects() const
ArrayRef< EffectConditionExpr > conditions() const
static FunctionEffectsRef create(ArrayRef< FunctionEffect > FX, ArrayRef< EffectConditionExpr > Conds)
Asserts invariants.
FunctionEffectsRef()=default
Represents a K&R-style 'int foo()' function, which has no information available about its arguments.
Represents a prototype with parameter type info, e.g.
bool hasDependentExceptionSpec() const
Return whether this function has a dependent exception spec.
param_type_iterator param_type_begin() const
ExceptionSpecificationType getExceptionSpecType() const
Get the kind of exception specification on this function.
bool isTemplateVariadic() const
Determines whether this function prototype contains a parameter pack at the end.
unsigned getNumParams() const
bool hasTrailingReturn() const
Whether this function prototype has a trailing return type.
QualType getParamType(unsigned i) const
QualType getExceptionType(unsigned i) const
Return the ith exception type, where 0 <= i < getNumExceptions().
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
unsigned getNumExceptions() const
Return the number of types in the exception specification.
CanThrowResult canThrow() const
Determine whether this function type has a non-throwing exception specification.
ExtProtoInfo getExtProtoInfo() const
Expr * getNoexceptExpr() const
Return the expression inside noexcept(expression), or a null pointer if there is none (because the ex...
ArrayRef< QualType > getParamTypes() const
ArrayRef< QualType > exceptions() const
bool hasInstantiationDependentExceptionSpec() const
Return whether this function has an instantiation-dependent exception spec.
A class which abstracts out some details necessary for making a call.
FunctionType - C99 6.7.5.3 - Function Declarators.
ExtInfo getExtInfo() const
static StringRef getNameForCallConv(CallingConv CC)
QualType getReturnType() const
static const HLSLAttributedResourceType * findHandleTypeOnResource(const Type *RT)
One of these records is kept for each identifier that is lexed.
bool isStr(const char(&Str)[StrLen]) const
Return true if this is the identifier for the specified string.
Represents a C array with an unspecified size.
CXXRecordDecl * getDecl() const
An lvalue reference type, per C++11 [dcl.ref].
LinkageInfo computeTypeLinkageInfo(const Type *T)
LinkageInfo getTypeLinkageAndVisibility(const Type *T)
LinkageInfo getDeclLinkageAndVisibility(const NamedDecl *D)
static LinkageInfo external()
Linkage getLinkage() const
void merge(LinkageInfo other)
Merge both linkage and visibility.
Sugar type that represents a type that was qualified by a qualifier written as a macro invocation.
QualType getModifiedType() const
Return this attributed type's modified type with no qualifiers attached to it.
QualType getUnderlyingType() const
const IdentifierInfo * getMacroIdentifier() const
Represents a matrix type, as defined in the Matrix Types clang extensions.
MatrixType(QualType ElementTy, QualType CanonElementTy)
QualType ElementType
The element type of the matrix.
A pointer to member type per C++ 8.3.3 - Pointers to members.
CXXRecordDecl * getMostRecentCXXRecordDecl() const
const Type * getClass() const
This represents a decl that may have a name.
IdentifierInfo * getIdentifier() const
Get the identifier that names this declaration, if there is one.
Represents a C++ nested name specifier, such as "\::std::vector<int>::".
bool isDependent() const
Whether this nested name specifier refers to a dependent type or not.
ObjCCategoryDecl - Represents a category declaration.
ObjCInterfaceDecl * getClassInterface()
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameter list associated with this category or extension.
Represents an ObjC class declaration.
ObjCTypeParamList * getTypeParamList() const
Retrieve the type parameters of this class.
const ObjCObjectType * getSuperClassType() const
Retrieve the superclass type.
ObjCInterfaceDecl * getDefinition()
Retrieve the definition of this class, or NULL if this class has been forward-declared (with @class) ...
Interfaces are the core concept in Objective-C for object oriented design.
ObjCInterfaceDecl * getDecl() const
Get the declaration of this interface.
Represents a pointer to an Objective C object.
const ObjCObjectPointerType * stripObjCKindOfTypeAndQuals(const ASTContext &ctx) const
Strip off the Objective-C "kindof" type and (with it) any protocol qualifiers.
const ObjCObjectType * getObjectType() const
Gets the type pointed to by this ObjC pointer.
QualType getSuperClassType() const
Retrieve the type of the superclass of this object pointer type.
ObjCInterfaceDecl * getInterfaceDecl() const
If this pointer points to an Objective @interface type, gets the declaration for that interface.
const ObjCInterfaceType * getInterfaceType() const
If this pointer points to an Objective C @interface type, gets the type for that interface.
bool isKindOfType() const
Whether this is a "__kindof" type.
void Profile(llvm::FoldingSetNodeID &ID)
Represents a class type in Objective C.
bool isKindOfTypeAsWritten() const
Whether this is a "__kindof" type as written.
bool isSpecialized() const
Determine whether this object type is "specialized", meaning that it has type arguments.
ObjCObjectType(QualType Canonical, QualType Base, ArrayRef< QualType > typeArgs, ArrayRef< ObjCProtocolDecl * > protocols, bool isKindOf)
ArrayRef< QualType > getTypeArgsAsWritten() const
Retrieve the type arguments of this object type as they were written.
QualType getBaseType() const
Gets the base type of this object type.
bool isKindOfType() const
Whether this ia a "__kindof" type (semantically).
bool isSpecializedAsWritten() const
Determine whether this object type was written with type arguments.
ArrayRef< QualType > getTypeArgs() const
Retrieve the type arguments of this object type (semantically).
bool isUnspecialized() const
Determine whether this object type is "unspecialized", meaning that it has no type arguments.
QualType stripObjCKindOfTypeAndQuals(const ASTContext &ctx) const
Strip off the Objective-C "kindof" type and (with it) any protocol qualifiers.
void computeSuperClassTypeSlow() const
ObjCInterfaceDecl * getInterface() const
Gets the interface declaration for this object type, if the base type really is an interface.
QualType getSuperClassType() const
Retrieve the type of the superclass of this object type.
Represents an Objective-C protocol declaration.
void initialize(ArrayRef< ObjCProtocolDecl * > protocols)
ArrayRef< ObjCProtocolDecl * > getProtocols() const
Retrieve all of the protocol qualifiers.
unsigned getNumProtocols() const
Return the number of qualifying protocols in this type, or 0 if there are none.
qual_iterator qual_end() const
qual_iterator qual_begin() const
Represents the declaration of an Objective-C type parameter.
unsigned getIndex() const
Retrieve the index into its type parameter list.
Stores a list of Objective-C type parameters for a parameterized class or a category/extension thereo...
unsigned size() const
Determine the number of type parameters in this list.
Represents a type parameter type in Objective C.
void Profile(llvm::FoldingSetNodeID &ID)
ObjCTypeParamDecl * getDecl() const
Represents a pack expansion of types.
void Profile(llvm::FoldingSetNodeID &ID)
Expr * getIndexExpr() const
PackIndexingType(const ASTContext &Context, QualType Canonical, QualType Pattern, Expr *IndexExpr, bool FullySubstituted, ArrayRef< QualType > Expansions={})
std::optional< unsigned > getSelectedIndex() const
Sugar for parentheses used when specifying types.
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
bool isTriviallyCopyableType(const ASTContext &Context) const
Return true if this is a trivially copyable type (C++0x [basic.types]p9)
QualType IgnoreParens() const
Returns the specified type after dropping any outer-level parentheses.
QualType withFastQualifiers(unsigned TQs) const
bool hasNonTrivialToPrimitiveCopyCUnion() const
Check if this is or contains a C union that is non-trivial to copy, which is a union that has a membe...
bool isWebAssemblyFuncrefType() const
Returns true if it is a WebAssembly Funcref Type.
QualType getNonLValueExprType(const ASTContext &Context) const
Determine the type of a (typically non-lvalue) expression with the specified result type.
@ DK_objc_strong_lifetime
PrimitiveDefaultInitializeKind
@ PDIK_ARCWeak
The type is an Objective-C retainable pointer type that is qualified with the ARC __weak qualifier.
@ PDIK_Trivial
The type does not fall into any of the following categories.
@ PDIK_ARCStrong
The type is an Objective-C retainable pointer type that is qualified with the ARC __strong qualifier.
@ PDIK_Struct
The type is a struct containing a field whose type is not PCK_Trivial.
bool mayBeDynamicClass() const
Returns true if it is a class and it might be dynamic.
bool isNonWeakInMRRWithObjCWeak(const ASTContext &Context) const
const IdentifierInfo * getBaseTypeIdentifier() const
Retrieves a pointer to the name of the base type.
bool isBitwiseCloneableType(const ASTContext &Context) const
Return true if the type is safe to bitwise copy using memcpy/memmove.
void Profile(llvm::FoldingSetNodeID &ID) const
QualType getDesugaredType(const ASTContext &Context) const
Return the specified type with any "sugar" removed from the type.
bool isTriviallyCopyConstructibleType(const ASTContext &Context) const
Return true if this is a trivially copyable type.
bool isTrivialType(const ASTContext &Context) const
Return true if this is a trivial type per (C++0x [basic.types]p9)
bool isNull() const
Return true if this QualType doesn't point to a type yet.
PrimitiveCopyKind isNonTrivialToPrimitiveCopy() const
Check if this is a non-trivial type that would cause a C struct transitively containing this type to ...
bool isTriviallyRelocatableType(const ASTContext &Context) const
Return true if this is a trivially relocatable type.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
LangAS getAddressSpace() const
Return the address space of this type.
bool isConstant(const ASTContext &Ctx) const
bool hasNonTrivialToPrimitiveDestructCUnion() const
Check if this is or contains a C union that is non-trivial to destruct, which is a union that has a m...
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
bool isCXX98PODType(const ASTContext &Context) const
Return true if this is a POD type according to the rules of the C++98 standard, regardless of the cur...
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
QualType stripObjCKindOfType(const ASTContext &ctx) const
Strip Objective-C "__kindof" types from the given type.
QualType getCanonicalType() const
QualType getUnqualifiedType() const
Retrieve the unqualified variant of the given type, removing as little sugar as possible.
QualType substObjCMemberType(QualType objectType, const DeclContext *dc, ObjCSubstitutionContext context) const
Substitute type arguments from an object type for the Objective-C type parameters used in the subject...
bool isWebAssemblyReferenceType() const
Returns true if it is a WebAssembly Reference Type.
SplitQualType getSplitDesugaredType() const
std::optional< NonConstantStorageReason > isNonConstantStorage(const ASTContext &Ctx, bool ExcludeCtor, bool ExcludeDtor)
Determine whether instances of this type can be placed in immutable storage.
SplitQualType split() const
Divides a QualType into its unqualified type and a set of local qualifiers.
bool UseExcessPrecision(const ASTContext &Ctx)
PrimitiveDefaultInitializeKind isNonTrivialToPrimitiveDefaultInitialize() const
Functions to query basic properties of non-trivial C struct types.
void * getAsOpaquePtr() const
bool isWebAssemblyExternrefType() const
Returns true if it is a WebAssembly Externref Type.
QualType getNonPackExpansionType() const
Remove an outer pack expansion type (if any) from this type.
bool isCXX11PODType(const ASTContext &Context) const
Return true if this is a POD type according to the more relaxed rules of the C++11 standard,...
bool mayBeNotDynamicClass() const
Returns true if it is not a class or if the class might not be dynamic.
bool isConstQualified() const
Determine whether this type is const-qualified.
QualType substObjCTypeArgs(ASTContext &ctx, ArrayRef< QualType > typeArgs, ObjCSubstitutionContext context) const
Substitute type arguments for the Objective-C type parameters used in the subject type.
QualType getAtomicUnqualifiedType() const
Remove all qualifiers including _Atomic.
DestructionKind isDestructedType() const
Returns a nonzero value if objects of this type require non-trivial work to clean up after.
bool hasNonTrivialObjCLifetime() const
bool isPODType(const ASTContext &Context) const
Determine whether this is a Plain Old Data (POD) type (C++ 3.9p10).
PrimitiveCopyKind isNonTrivialToPrimitiveDestructiveMove() const
Check if this is a non-trivial type that would cause a C struct transitively containing this type to ...
@ NonConstNonReferenceType
@ PCK_Struct
The type is a struct containing a field whose type is neither PCK_Trivial nor PCK_VolatileTrivial.
@ PCK_Trivial
The type does not fall into any of the following categories.
@ PCK_ARCStrong
The type is an Objective-C retainable pointer type that is qualified with the ARC __strong qualifier.
@ PCK_VolatileTrivial
The type would be trivial except that it is volatile-qualified.
@ PCK_ARCWeak
The type is an Objective-C retainable pointer type that is qualified with the ARC __weak qualifier.
bool hasNonTrivialToPrimitiveDefaultInitializeCUnion() const
Check if this is or contains a C union that is non-trivial to default-initialize, which is a union th...
A qualifier set is used to build a set of qualifiers.
const Type * strip(QualType type)
Collect any qualifiers on the given type and return an unqualified type.
QualType apply(const ASTContext &Context, QualType QT) const
Apply the collected qualifiers to the given type.
The collection of all-type qualifiers we support.
@ OCL_Strong
Assigning into this object requires the old value to be released and the new value to be retained.
@ OCL_ExplicitNone
This object can be modified without requiring retains or releases.
@ OCL_None
There is no lifetime qualification on this type.
@ OCL_Weak
Reading or writing from this object requires a barrier call.
@ OCL_Autoreleasing
Assigning into this object requires a lifetime extension.
bool isStrictSupersetOf(Qualifiers Other) const
Determine whether this set of qualifiers is a strict superset of another set of qualifiers,...
bool hasNonFastQualifiers() const
Return true if the set contains any qualifiers which require an ExtQuals node to be allocated.
void addConsistentQualifiers(Qualifiers qs)
Add the qualifiers from the given set to this set, given that they don't conflict.
static bool isTargetAddressSpaceSupersetOf(LangAS A, LangAS B, const ASTContext &Ctx)
bool hasAddressSpace() const
unsigned getFastQualifiers() const
bool hasObjCGCAttr() const
bool hasObjCLifetime() const
ObjCLifetime getObjCLifetime() const
LangAS getAddressSpace() const
An rvalue reference type, per C++11 [dcl.ref].
Represents a struct/union/class.
bool hasNonTrivialToPrimitiveDestructCUnion() const
bool hasNonTrivialToPrimitiveCopyCUnion() const
bool hasNonTrivialToPrimitiveDefaultInitializeCUnion() const
bool isNonTrivialToPrimitiveDestroy() const
field_range fields() const
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
RecordDecl * getDecl() const
bool hasConstFields() const
Recursively check all fields in the record for const-ness.
Declaration of a redeclarable template.
redecl_range redecls() const
Returns an iterator range for all the redeclarations of the same decl.
Base for LValueReferenceType and RValueReferenceType.
Encodes a location in the source.
A trivial tuple used to represent a source range.
Stmt - This represents one statement.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context, bool Canonical, bool ProfileLambdaExpr=false) const
Produce a unique representation of the given statement.
void dump() const
Dumps the specified AST fragment and all subtrees to llvm::errs().
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
IdentifierInfo * getIdentifier() const
TemplateArgument getArgumentPack() const
void Profile(llvm::FoldingSetNodeID &ID)
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
unsigned getNumArgs() const
const TemplateTypeParmDecl * getReplacedParameter() const
Gets the template parameter declaration that was substituted for.
Represents the result of substituting a type for a template type parameter.
Decl * getAssociatedDecl() const
A template-like entity which owns the whole pattern being substituted.
unsigned getIndex() const
Returns the index of the replaced parameter in the associated declaration.
const TemplateTypeParmDecl * getReplacedParameter() const
Gets the template parameter declaration that was substituted for.
Represents the declaration of a struct/union/class/enum.
bool isBeingDefined() const
Return true if this decl is currently being defined.
bool isCompleteDefinition() const
Return true if this decl has its body fully specified.
TagType(TypeClass TC, const TagDecl *D, QualType can)
TagDecl * getDecl() const
bool isBeingDefined() const
Determines whether this type is in the process of being defined.
bool isMicrosoft() const
Is this ABI an MSVC-compatible ABI?
Exposes information about the current target.
virtual bool hasLegalHalfType() const
Determine whether _Float16 is supported on this target.
virtual bool hasFullBFloat16Type() const
Determine whether the BFloat type is fully supported on this target, i.e arithemtic operations.
virtual bool hasFloat16Type() const
Determine whether the _Float16 type is supported on this target.
TargetCXXABI getCXXABI() const
Get the C++ ABI currently in use.
virtual bool hasBFloat16Type() const
Determine whether the _BFloat16 type is supported on this target.
virtual bool isAddressSpaceSupersetOf(LangAS A, LangAS B) const
Returns true if an address space can be safely converted to another.
A convenient class for passing around template argument information.
llvm::ArrayRef< TemplateArgumentLoc > arguments() const
Location wrapper for a TemplateArgument.
Represents a template argument.
unsigned pack_size() const
The number of template arguments in the given template argument pack.
ArrayRef< TemplateArgument > pack_elements() const
Iterator range referencing all of the elements of a template argument pack.
@ Type
The template argument is a type.
The base class of all kinds of template declarations (e.g., class, function, etc.).
Represents a C++ template name within the type system.
@ UsingTemplate
A template name that refers to a template declaration found through a specific using shadow declarati...
@ Template
A single template declaration.
@ SubstTemplateTemplateParm
A template template parameter that has been substituted for some other template name.
@ SubstTemplateTemplateParmPack
A template template parameter pack that has been substituted for a template template argument pack,...
@ DeducedTemplate
A template name that refers to another TemplateName with deduced default arguments.
@ QualifiedTemplate
A qualified template name, where the qualification is kept to describe the source code as written.
Represents a type template specialization; the template must be a class template, a type alias templa...
QualType getAliasedType() const
Get the aliased type, if this is a specialization of a type alias template.
ArrayRef< TemplateArgument > template_arguments() const
bool isTypeAlias() const
Determine if this template specialization type is for a type alias template that has been substituted...
static bool anyInstantiationDependentTemplateArguments(ArrayRef< TemplateArgumentLoc > Args)
static bool anyDependentTemplateArguments(ArrayRef< TemplateArgumentLoc > Args, ArrayRef< TemplateArgument > Converted)
Determine whether any of the given template arguments are dependent.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
Declaration of a template type parameter.
TemplateTypeParmDecl * getDecl() const
IdentifierInfo * getIdentifier() const
[BoundsSafety] Represents information of declarations referenced by the arguments of the counted_by a...
ValueDecl * getDecl() const
bool operator==(const TypeCoupledDeclRefInfo &Other) const
void * getOpaqueValue() const
TypeCoupledDeclRefInfo(ValueDecl *D=nullptr, bool Deref=false)
D is to a declaration referenced by the argument of attribute.
void setFromOpaqueValue(void *V)
bool isSugared() const
Returns whether this type directly provides sugar.
TypeOfKind getKind() const
Returns the kind of 'typeof' type this is.
TypeOfExprType(const ASTContext &Context, Expr *E, TypeOfKind Kind, QualType Can=QualType())
Expr * getUnderlyingExpr() const
QualType desugar() const
Remove a single level of sugar.
TypeOfKind getKind() const
Returns the kind of 'typeof' type this is.
QualType desugar() const
Remove a single level of sugar.
QualType getUnmodifiedType() const
static void ensure(const Type *T)
static CachedProperties get(QualType T)
static CachedProperties get(const Type *T)
A helper class for Type nodes having an ElaboratedTypeKeyword.
static ElaboratedTypeKeyword getKeywordForTypeSpec(unsigned TypeSpec)
Converts a type specifier (DeclSpec::TST) into an elaborated type keyword.
static TagTypeKind getTagTypeKindForKeyword(ElaboratedTypeKeyword Keyword)
Converts an elaborated type keyword into a TagTypeKind.
static bool KeywordIsTagTypeKind(ElaboratedTypeKeyword Keyword)
static StringRef getKeywordName(ElaboratedTypeKeyword Keyword)
static ElaboratedTypeKeyword getKeywordForTagTypeKind(TagTypeKind Tag)
Converts a TagTypeKind into an elaborated type keyword.
static TagTypeKind getTagTypeKindForTypeSpec(unsigned TypeSpec)
Converts a type specifier (DeclSpec::TST) into a tag type kind.
The base class of the type hierarchy.
bool isSizelessType() const
As an extension, we classify types as one of "sized" or "sizeless"; every type is one or the other.
bool isStructureType() const
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
bool isBlockPointerType() const
const ObjCObjectPointerType * getAsObjCQualifiedClassType() const
bool isLinkageValid() const
True if the computed linkage is valid.
TypedefBitfields TypedefBits
const ObjCObjectType * getAsObjCQualifiedInterfaceType() const
const ObjCObjectPointerType * getAsObjCQualifiedIdType() const
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
bool hasAttr(attr::Kind AK) const
Determine whether this type had the specified attribute applied to it (looking through top-level type...
QualType getRVVEltType(const ASTContext &Ctx) const
Returns the representative type for the element of an RVV builtin type.
const RecordType * getAsUnionType() const
NOTE: getAs*ArrayType are methods on ASTContext.
bool isLiteralType(const ASTContext &Ctx) const
Return true if this is a literal type (C++11 [basic.types]p10)
bool isSignedIntegerType() const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char,...
bool isComplexType() const
isComplexType() does not include complex integers (a GCC extension).
ArrayTypeBitfields ArrayTypeBits
const ArrayType * castAsArrayTypeUnsafe() const
A variant of castAs<> for array type which silently discards qualifiers from the outermost type.
bool isUnsignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is unsigned or an enumeration types whose underlying ...
bool isIntegralOrUnscopedEnumerationType() const
Determine whether this type is an integral or unscoped enumeration type.
VectorTypeBitfields VectorTypeBits
bool hasIntegerRepresentation() const
Determine whether this type has an integer representation of some sort, e.g., it is an integer type o...
bool isVoidPointerType() const
const ComplexType * getAsComplexIntegerType() const
bool isConstantSizeType() const
Return true if this is not a variable sized type, according to the rules of C99 6....
QualType getLocallyUnqualifiedSingleStepDesugaredType() const
Pull a single level of sugar off of this locally-unqualified type.
bool isFunctionPointerType() const
bool isCountAttributedType() const
bool isObjCARCBridgableType() const
Determine whether the given type T is a "bridgable" Objective-C type, which is either an Objective-C ...
bool isArithmeticType() const
bool isHLSLBuiltinIntangibleType() const
TypeOfBitfields TypeOfBits
bool isIntegerType() const
isIntegerType() does not include complex integers (a GCC extension).
bool isSVESizelessBuiltinType() const
Returns true for SVE scalable vector types.
const T * castAs() const
Member-template castAs<specific type>.
bool isReferenceType() const
bool isHLSLIntangibleType() const
bool isEnumeralType() const
void addDependence(TypeDependence D)
bool isObjCNSObjectType() const
const ObjCObjectPointerType * getAsObjCInterfacePointerType() const
bool isScalarType() const
const CXXRecordDecl * getPointeeCXXRecordDecl() const
If this is a pointer or reference to a RecordType, return the CXXRecordDecl that the type refers to.
bool isInterfaceType() const
bool isVariableArrayType() const
bool isSizelessBuiltinType() const
bool isCUDADeviceBuiltinSurfaceType() const
Check if the type is the CUDA device builtin surface type.
bool isSveVLSBuiltinType() const
Determines if this is a sizeless type supported by the 'arm_sve_vector_bits' type attribute,...
bool isIntegralType(const ASTContext &Ctx) const
Determine whether this type is an integral type.
bool isElaboratedTypeSpecifier() const
Determine wither this type is a C++ elaborated-type-specifier.
CountAttributedTypeBitfields CountAttributedTypeBits
const Type * getArrayElementTypeNoTypeQual() const
If this is an array type, return the element type of the array, potentially with type qualifiers miss...
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
LinkageInfo getLinkageAndVisibility() const
Determine the linkage and visibility of this type.
bool hasUnsignedIntegerRepresentation() const
Determine whether this type has an unsigned integer representation of some sort, e....
bool isAnyCharacterType() const
Determine whether this type is any of the built-in character types.
bool isWebAssemblyExternrefType() const
Check if this is a WebAssembly Externref Type.
bool canHaveNullability(bool ResultIfUnknown=true) const
Determine whether the given type can have a nullability specifier applied to it, i....
QualType getSveEltType(const ASTContext &Ctx) const
Returns the representative type for the element of an SVE builtin type.
bool isInstantiationDependentType() const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a temp...
bool isLValueReferenceType() const
bool isBitIntType() const
bool isBuiltinType() const
Helper methods to distinguish type categories.
bool isStructuralType() const
Determine if this type is a structural type, per C++20 [temp.param]p7.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
bool isAggregateType() const
Determines whether the type is a C++ aggregate type or C aggregate or union type.
bool isCARCBridgableType() const
Determine whether the given type T is a "bridgeable" C type.
bool isChar16Type() const
bool isAnyComplexType() const
DependentTemplateSpecializationTypeBitfields DependentTemplateSpecializationTypeBits
DeducedType * getContainedDeducedType() const
Get the DeducedType whose type will be deduced for a variable with an initializer of this type.
bool containsUnexpandedParameterPack() const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templat...
ScalarTypeKind getScalarTypeKind() const
Given that this is a scalar type, classify it.
bool hasSignedIntegerRepresentation() const
Determine whether this type has an signed integer representation of some sort, e.g....
QualType getCanonicalTypeInternal() const
const RecordType * getAsStructureType() const
const char * getTypeClassName() const
bool isWebAssemblyTableType() const
Returns true if this is a WebAssembly table type: either an array of reference types,...
const Type * getBaseElementTypeUnsafe() const
Get the base element type of this type, potentially discarding type qualifiers.
AttributedTypeBitfields AttributedTypeBits
bool isObjCBoxableRecordType() const
bool isChar32Type() const
bool isStandardLayoutType() const
Test if this type is a standard-layout type.
bool isVariablyModifiedType() const
Whether this type is a variably-modified type (C99 6.7.5).
bool isComplexIntegerType() const
bool isUnscopedEnumerationType() const
bool isStdByteType() const
bool isCUDADeviceBuiltinTextureType() const
Check if the type is the CUDA device builtin texture type.
bool isBlockCompatibleObjCPointerType(ASTContext &ctx) const
bool isObjCClassOrClassKindOfType() const
Whether the type is Objective-C 'Class' or a __kindof type of an Class type, e.g.,...
const ArrayType * getAsArrayTypeUnsafe() const
A variant of getAs<> for array types which silently discards qualifiers from the outermost type.
bool isObjCLifetimeType() const
Returns true if objects of this type have lifetime semantics under ARC.
bool isObjectType() const
Determine whether this type is an object type.
bool isObjCIndirectLifetimeType() const
bool hasUnnamedOrLocalType() const
Whether this type is or contains a local or unnamed type.
bool isPointerOrReferenceType() const
Qualifiers::ObjCLifetime getObjCARCImplicitLifetime() const
Return the implicit lifetime for this type, which must not be dependent.
FunctionTypeBitfields FunctionTypeBits
bool isObjCQualifiedInterfaceType() const
bool isSpecifierType() const
Returns true if this type can be represented by some set of type specifiers.
bool isIncompleteType(NamedDecl **Def=nullptr) const
Types are partitioned into 3 broad categories (C99 6.2.5p1): object types, function types,...
bool isObjCObjectPointerType() const
bool isStructureTypeWithFlexibleArrayMember() const
TypeDependence getDependence() const
bool hasFloatingRepresentation() const
Determine whether this type has a floating-point representation of some sort, e.g....
bool isStructureOrClassType() const
bool isVectorType() const
bool isRVVVLSBuiltinType() const
Determines if this is a sizeless type supported by the 'riscv_rvv_vector_bits' type attribute,...
bool isRealFloatingType() const
Floating point categories.
bool isRVVSizelessBuiltinType() const
Returns true for RVV scalable vector types.
std::optional< ArrayRef< QualType > > getObjCSubstitutions(const DeclContext *dc) const
Retrieve the set of substitutions required when accessing a member of the Objective-C receiver type t...
Linkage getLinkage() const
Determine the linkage of this type.
ObjCObjectTypeBitfields ObjCObjectTypeBits
bool isFloatingType() const
const ObjCObjectType * getAsObjCInterfaceType() const
bool isWideCharType() const
bool isUnsignedIntegerType() const
Return true if this is an integer type that is unsigned, according to C99 6.2.5p6 [which returns true...
bool hasSizedVLAType() const
Whether this type involves a variable-length array type with a definite size.
TypeClass getTypeClass() const
bool isCanonicalUnqualified() const
Determines if this type would be canonical if it had no further qualification.
bool hasAutoForTrailingReturnType() const
Determine whether this type was written with a leading 'auto' corresponding to a trailing return type...
bool isObjCIdOrObjectKindOfType(const ASTContext &ctx, const ObjCObjectType *&bound) const
Whether the type is Objective-C 'id' or a __kindof type of an object type, e.g., __kindof NSView * or...
const T * getAs() const
Member-template getAs<specific type>'.
SubstTemplateTypeParmPackTypeBitfields SubstTemplateTypeParmPackTypeBits
const Type * getUnqualifiedDesugaredType() const
Return the specified type with any "sugar" removed from the type, removing any typedefs,...
bool isObjCARCImplicitlyUnretainedType() const
Determines if this type, which must satisfy isObjCLifetimeType(), is implicitly __unsafe_unretained r...
bool isRecordType() const
TemplateSpecializationTypeBitfields TemplateSpecializationTypeBits
bool isObjCRetainableType() const
std::optional< NullabilityKind > getNullability() const
Determine the nullability of the given type.
bool isObjCIndependentClassType() const
TagDecl * getAsTagDecl() const
Retrieves the TagDecl that this type refers to, either because the type is a TagType or because it is...
bool isSizelessVectorType() const
Returns true for all scalable vector types.
bool isScopedEnumeralType() const
Determine whether this type is a scoped enumeration type.
bool acceptsObjCTypeParams() const
Determines if this is an ObjC interface type that may accept type parameters.
QualType getSizelessVectorEltType(const ASTContext &Ctx) const
Returns the representative type for the element of a sizeless vector builtin type.
RecordDecl * getAsRecordDecl() const
Retrieves the RecordDecl this type refers to.
Base class for declarations which introduce a typedef-name.
QualType getUnderlyingType() const
bool typeMatchesDecl() const
A unary type transform, which is a type constructed from another.
UnaryTransformType(QualType BaseTy, QualType UnderlyingTy, UTTKind UKind, QualType CanonicalTy)
Represents a shadow declaration implicitly introduced into a scope by a (resolved) using-declaration ...
QualType getUnderlyingType() const
bool typeMatchesDecl() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a C array with a specified size that is not an integer-constant-expression.
Represents a GCC generic vector type.
VectorType(QualType vecType, unsigned nElements, QualType canonType, VectorKind vecKind)
QualType getElementType() const
Defines the Linkage enumeration and various utility functions.
Defines the clang::TargetInfo interface.
const internal::VariadicAllOfMatcher< Attr > attr
Matches attributes.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const AstTypeMatcher< TypedefType > typedefType
Matches typedef types.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
The JSON file list parser is used to communicate input to InstallAPI.
AutoTypeKeyword
Which keyword(s) were used to create an AutoType.
CanThrowResult
Possible results from evaluation of a noexcept expression.
void initialize(TemplateInstantiationCallbackPtrs &Callbacks, const Sema &TheSema)
Linkage minLinkage(Linkage L1, Linkage L2)
Compute the minimum linkage given two linkages.
@ Nullable
Values of this type can be null.
@ Unspecified
Whether values of this type can be null is (explicitly) unspecified.
@ NonNull
Values of this type can never be null.
ExprDependence computeDependence(FullExpr *E)
@ Private
'private' clause, allowed on 'parallel', 'serial', 'loop', 'parallel loop', and 'serial loop' constru...
@ Vector
'vector' clause, allowed on 'loop', Combined, and 'routine' directives.
TypeOfKind
The kind of 'typeof' expression we're after.
TypeDependence toTypeDependence(ExprDependence D)
ExprDependence turnValueToTypeDependence(ExprDependence D)
const StreamingDiagnostic & operator<<(const StreamingDiagnostic &DB, const ASTContext::SectionInfo &Section)
Insertion operator for diagnostics.
Linkage
Describes the different kinds of linkage (C++ [basic.link], C99 6.2.2) that an entity may have.
@ External
External linkage, which indicates that the entity can be referred to from other translation units.
ObjCSubstitutionContext
The kind of type we are substituting Objective-C type arguments into.
@ Superclass
The superclass of a type.
@ Result
The result type of a method or function.
ArraySizeModifier
Capture whether this is a normal array (e.g.
bool isComputedNoexcept(ExceptionSpecificationType ESpecType)
SubstTemplateTypeParmTypeFlag
TemplateParameterList * getReplacedTemplateParameterList(Decl *D)
Internal helper used by Subst* nodes to retrieve the parameter list for their AssociatedDecl.
TagTypeKind
The kind of a tag type.
@ Interface
The "__interface" keyword.
@ Struct
The "struct" keyword.
@ Class
The "class" keyword.
@ Union
The "union" keyword.
@ Enum
The "enum" keyword.
LangAS
Defines the address space values used by the address space qualifier of QualType.
void FixedPointValueToString(SmallVectorImpl< char > &Str, llvm::APSInt Val, unsigned Scale)
bool isPtrSizeAddressSpace(LangAS AS)
const FunctionProtoType * T
CallingConv
CallingConv - Specifies the calling convention that a function uses.
@ None
The alignment was not explicit in code.
ElaboratedTypeKeyword
The elaboration keyword that precedes a qualified type name or introduces an elaborated-type-specifie...
@ Interface
The "__interface" keyword introduces the elaborated-type-specifier.
@ None
No keyword precedes the qualified type name.
@ Struct
The "struct" keyword introduces the elaborated-type-specifier.
@ Class
The "class" keyword introduces the elaborated-type-specifier.
@ Union
The "union" keyword introduces the elaborated-type-specifier.
@ Enum
The "enum" keyword introduces the elaborated-type-specifier.
@ Typename
The "typename" keyword precedes the qualified type name, e.g., typename T::type.
TypeDependence toSemanticDependence(TypeDependence D)
TypeDependence toSyntacticDependence(TypeDependence D)
@ Other
Other implicit parameter.
@ EST_DependentNoexcept
noexcept(expression), value-dependent
@ EST_DynamicNone
throw()
@ EST_Uninstantiated
not instantiated yet
@ EST_Unparsed
not parsed yet
@ EST_NoThrow
Microsoft __declspec(nothrow) extension.
@ EST_None
no exception specification
@ EST_MSAny
Microsoft throw(...) extension.
@ EST_BasicNoexcept
noexcept
@ EST_NoexceptFalse
noexcept(expression), evals to 'false'
@ EST_Unevaluated
not evaluated yet, for special member function
@ EST_NoexceptTrue
noexcept(expression), evals to 'true'
@ EST_Dynamic
throw(T1, T2)
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
A FunctionEffect plus a potential boolean expression determining whether the effect is declared (e....
std::string description() const
Return a textual description of the effect, and its condition, if any.
FunctionDecl * SourceDecl
The function whose exception specification this is, for EST_Unevaluated and EST_Uninstantiated.
FunctionDecl * SourceTemplate
The function template whose exception specification this is instantiated from, for EST_Uninstantiated...
ExceptionSpecificationType Type
The kind of exception specification this is.
ArrayRef< QualType > Exceptions
Explicitly-specified list of exception types.
Expr * NoexceptExpr
Noexcept expression, if this is a computed noexcept specification.
Extra information about a function prototype.
ExceptionSpecInfo ExceptionSpec
bool requiresFunctionProtoTypeArmAttributes() const
unsigned AArch64SMEAttributes
SourceLocation EllipsisLoc
FunctionEffectsRef FunctionEffects
const ExtParameterInfo * ExtParameterInfos
RefQualifierKind RefQualifier
unsigned HasTrailingReturn
bool requiresFunctionProtoTypeExtraBitfields() const
Describes how types, statements, expressions, and declarations should be printed.
unsigned Bool
Whether we can use 'bool' rather than '_Bool' (even if the language doesn't actually have 'bool',...
unsigned NullptrTypeInNamespace
Whether 'nullptr_t' is in namespace 'std' or not.
unsigned Half
When true, print the half-precision floating-point type as 'half' instead of '__fp16'.
unsigned MSWChar
When true, print the built-in wchar_t type as __wchar_t.
A std::pair-like structure for storing a qualified type split into its local qualifiers and its local...
const Type * Ty
The locally-unqualified type.
Qualifiers Quals
The local qualifiers.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4