class AttributedType
Declaration
class AttributedType : public Type, public Node { /* full declaration omitted */ };
Description
An attributed type is a type to which a type attribute has been applied. The "modified type" is the fully-sugared type to which the attributed type was applied; generally it is not canonically equivalent to the attributed type. The "equivalent type" is the minimally-desugared type which the type is canonically equivalent to. For example, in the following attributed type: int32_t __attribute__((vector_size(16))) - the modified type is the TypedefType for int32_t - the equivalent type is VectorType(16, int32_t) - the canonical type is VectorType(16, int)
Declared at: clang/include/clang/AST/Type.h:4761
Inherits from: Type, FoldingSetBase::Node
Member Variables
- private clang::QualType ModifiedType
- private clang::QualType EquivalentType
Inherited from Type:
Method Overview
- private AttributedType(clang::QualType canon, attr::Kind attrKind, clang::QualType modified, clang::QualType equivalent)
- public void Profile(llvm::FoldingSetNodeID & ID)
- public static void Profile(llvm::FoldingSetNodeID & ID, clang::AttributedType::Kind attrKind, clang::QualType modified, clang::QualType equivalent)
- public static bool classof(const clang::Type * T)
- public clang::QualType desugar() const
- public clang::AttributedType::Kind getAttrKind() const
- public clang::QualType getEquivalentType() const
- public llvm::Optional<NullabilityKind> getImmediateNullability() const
- public clang::QualType getModifiedType() const
- public static clang::AttributedType::Kind getNullabilityAttrKind(clang::NullabilityKind kind)
- public bool isCallingConv() const
- public bool isMSTypeSpec() const
- public bool isQualifier() const
- public bool isSugared() const
- public static Optional<clang::NullabilityKind> stripOuterNullability(clang::QualType & T)
Inherited from FoldingSetBase::Node:
Inherited from Type:
- public acceptsObjCTypeParams
- protected addDependence
- public canDecayToPointerType
- public canHaveNullability
- public castAs
- public castAsArrayTypeUnsafe
- public containsErrors
- public containsUnexpandedParameterPack
- public dump
- public dump
- public getArrayElementTypeNoTypeQual
- public getAs
- public getAsAdjusted
- public getAsArrayTypeUnsafe
- public getAsCXXRecordDecl
- public getAsComplexIntegerType
- public getAsObjCInterfacePointerType
- public getAsObjCInterfaceType
- public getAsObjCQualifiedClassType
- public getAsObjCQualifiedIdType
- public getAsObjCQualifiedInterfaceType
- public getAsPlaceholderType
- public getAsRecordDecl
- public getAsStructureType
- public getAsTagDecl
- public getAsUnionType
- public getBaseElementTypeUnsafe
- public getCanonicalTypeInternal
- public getCanonicalTypeUnqualified
- public getContainedAutoType
- public getContainedDeducedType
- public getDependence
- public getLinkage
- public getLinkageAndVisibility
- public getLocallyUnqualifiedSingleStepDesugaredType
- public getNullability
- public getObjCARCImplicitLifetime
- public getObjCSubstitutions
- public getPointeeCXXRecordDecl
- public getPointeeOrArrayElementType
- public getPointeeType
- public getScalarTypeKind
- public getSveEltType
- public getTypeClass
- public getTypeClassName
- public getUnqualifiedDesugaredType
- public getVisibility
- public hasAttr
- public hasAutoForTrailingReturnType
- public hasFloatingRepresentation
- public hasIntegerRepresentation
- public hasObjCPointerRepresentation
- public hasPointerRepresentation
- public hasSignedIntegerRepresentation
- public hasSizedVLAType
- public hasUnnamedOrLocalType
- public hasUnsignedIntegerRepresentation
- public isAggregateType
- public isAlignValT
- public isAnyCharacterType
- public isAnyComplexType
- public isAnyPointerType
- public isArithmeticType
- public isArrayType
- public isAtomicType
- public isBFloat16Type
- public isBitIntType
- public isBlockCompatibleObjCPointerType
- public isBlockPointerType
- public isBooleanType
- public isBuiltinType
- public isCARCBridgableType
- public isCUDADeviceBuiltinSurfaceType
- public isCUDADeviceBuiltinTextureType
- public isCanonicalUnqualified
- public isChar16Type
- public isChar32Type
- public isChar8Type
- public isCharType
- public isClassType
- public isClkEventT
- public isComplexIntegerType
- public isComplexType
- public isCompoundType
- public isConstantArrayType
- public isConstantMatrixType
- public isConstantSizeType
- public isDecltypeType
- public isDependentAddressSpaceType
- public isDependentSizedArrayType
- public isDependentType
- public isElaboratedTypeSpecifier
- public isEnumeralType
- public isEventT
- public isExtVectorBoolType
- public isExtVectorType
- public isFixedPointOrIntegerType
- public isFixedPointType
- public isFloat128Type
- public isFloat16Type
- public isFloatingType
- public isFromAST
- public isFunctionNoProtoType
- public isFunctionPointerType
- public isFunctionProtoType
- public isFunctionReferenceType
- public isFunctionType
- public isFundamentalType
- public isHalfType
- public isIbm128Type
- public isImageType
- public isIncompleteArrayType
- public isIncompleteOrObjectType
- public isIncompleteType
- public isInstantiationDependentType
- public isIntegerType
- public isIntegralOrEnumerationType
- public isIntegralOrUnscopedEnumerationType
- public isIntegralType
- public isInterfaceType
- public isLValueReferenceType
- public isLinkageValid
- public isLiteralType
- public isMatrixType
- public isMemberDataPointerType
- public isMemberFunctionPointerType
- public isMemberPointerType
- public isNonOverloadPlaceholderType
- public isNothrowT
- public isNullPtrType
- public isOCLExtOpaqueType
- public isOCLIntelSubgroupAVCType
- public isObjCARCBridgableType
- public isObjCARCImplicitlyUnretainedType
- public isObjCBoxableRecordType
- public isObjCBuiltinType
- public isObjCClassOrClassKindOfType
- public isObjCClassType
- public isObjCIdOrObjectKindOfType
- public isObjCIdType
- public isObjCIndependentClassType
- public isObjCIndirectLifetimeType
- public isObjCInertUnsafeUnretainedType
- public isObjCLifetimeType
- public isObjCNSObjectType
- public isObjCObjectOrInterfaceType
- public isObjCObjectPointerType
- public isObjCObjectType
- public isObjCQualifiedClassType
- public isObjCQualifiedIdType
- public isObjCQualifiedInterfaceType
- public isObjCRetainableType
- public isObjCSelType
- public isObjectPointerType
- public isObjectType
- public isOpenCLSpecificType
- public isOverloadableType
- public isPipeType
- public isPlaceholderType
- public isPointerType
- public isPromotableIntegerType
- public isQueueT
- public isRValueReferenceType
- public isRealFloatingType
- public isRealType
- public isRecordType
- public isReferenceType
- public isReserveIDT
- public isSamplerT
- public isSaturatedFixedPointType
- public isScalarType
- public isScopedEnumeralType
- public isSignedFixedPointType
- public isSignedIntegerOrEnumerationType
- public isSignedIntegerType
- public isSizelessBuiltinType
- public isSizelessType
- public isSpecificBuiltinType
- public isSpecificPlaceholderType
- public isSpecifierType
- public isStandardLayoutType
- public isStdByteType
- public isStructuralType
- public isStructureOrClassType
- public isStructureType
- public isTemplateTypeParmType
- public isTypedefNameType
- public isUndeducedAutoType
- public isUndeducedType
- public isUnionType
- public isUnsaturatedFixedPointType
- public isUnscopedEnumerationType
- public isUnsignedFixedPointType
- public isUnsignedIntegerOrEnumerationType
- public isUnsignedIntegerType
- public isVLSTBuiltinType
- public isVariableArrayType
- public isVariablyModifiedType
- public isVectorType
- public isVisibilityExplicit
- public isVoidPointerType
- public isVoidType
- public isWideCharType
- protected setDependence
- protected this_
Inherited from ExtQualsTypeCommonBase:
Methods
¶AttributedType(clang::QualType canon,
attr::Kind attrKind,
clang::QualType modified,
clang::QualType equivalent)
AttributedType(clang::QualType canon,
attr::Kind attrKind,
clang::QualType modified,
clang::QualType equivalent)
Declared at: clang/include/clang/AST/Type.h:4771
Parameters
- clang::QualType canon
- attr::Kind attrKind
- clang::QualType modified
- clang::QualType equivalent
¶void Profile(llvm::FoldingSetNodeID& ID)
void Profile(llvm::FoldingSetNodeID& ID)
Declared at: clang/include/clang/AST/Type.h:4842
Parameters
¶static void Profile(
llvm::FoldingSetNodeID& ID,
clang::AttributedType::Kind attrKind,
clang::QualType modified,
clang::QualType equivalent)
static void Profile(
llvm::FoldingSetNodeID& ID,
clang::AttributedType::Kind attrKind,
clang::QualType modified,
clang::QualType equivalent)
Declared at: clang/include/clang/AST/Type.h:4846
Parameters
- llvm::FoldingSetNodeID& ID
- clang::AttributedType::Kind attrKind
- clang::QualType modified
- clang::QualType equivalent
¶static bool classof(const clang::Type* T)
static bool classof(const clang::Type* T)
Declared at: clang/include/clang/AST/Type.h:4853
Parameters
- const clang::Type* T
¶clang::QualType desugar() const
clang::QualType desugar() const
Declared at: clang/include/clang/AST/Type.h:4787
¶clang::AttributedType::Kind getAttrKind() const
clang::AttributedType::Kind getAttrKind() const
Declared at: clang/include/clang/AST/Type.h:4779
¶clang::QualType getEquivalentType() const
clang::QualType getEquivalentType() const
Declared at: clang/include/clang/AST/Type.h:4784
¶llvm::Optional<NullabilityKind>
getImmediateNullability() const
llvm::Optional<NullabilityKind>
getImmediateNullability() const
Declared at: clang/include/clang/AST/Type.h:4810
¶clang::QualType getModifiedType() const
clang::QualType getModifiedType() const
Declared at: clang/include/clang/AST/Type.h:4783
¶static clang::AttributedType::Kind
getNullabilityAttrKind(
clang::NullabilityKind kind)
static clang::AttributedType::Kind
getNullabilityAttrKind(
clang::NullabilityKind kind)
Description
Retrieve the attribute kind corresponding to the given nullability kind.
Declared at: clang/include/clang/AST/Type.h:4814
Parameters
- clang::NullabilityKind kind
¶bool isCallingConv() const
bool isCallingConv() const
Declared at: clang/include/clang/AST/Type.h:4808
¶bool isMSTypeSpec() const
bool isMSTypeSpec() const
Declared at: clang/include/clang/AST/Type.h:4806
¶bool isQualifier() const
bool isQualifier() const
Description
Does this attribute behave like a type qualifier? A type qualifier adjusts a type to provide specialized rules for a specific object, like the standard const and volatile qualifiers. This includes attributes controlling things like nullability, address spaces, and ARC ownership. The value of the object is still largely described by the modified type. In contrast, many type attributes "rewrite" their modified type to produce a fundamentally different type, not necessarily related in any formalizable way to the original type. For example, calling convention and vector attributes are not simple type qualifiers. Type qualifiers are often, but not always, reflected in the canonical type.
Declared at: clang/include/clang/AST/Type.h:4804
¶bool isSugared() const
bool isSugared() const
Declared at: clang/include/clang/AST/Type.h:4786
¶static Optional<clang::NullabilityKind>
stripOuterNullability(clang::QualType& T)
static Optional<clang::NullabilityKind>
stripOuterNullability(clang::QualType& T)
Description
Strip off the top-level nullability annotation on the given type, if it's there.
Declared at: clang/include/clang/AST/Type.h:4840
Parameters
- clang::QualType& T
- The type to strip. If the type is exactly an AttributedType specifying nullability (without looking through type sugar), the nullability is returned and this type changed to the underlying modified type.
Returns
the top-level nullability, if present.