clang: clang::FunctionProtoType Class Reference (original) (raw)
Public Types
using
param_type_iterator = const QualType *
using
exception_iterator = const QualType *
Public Types inherited from clang::FunctionType
enum
AArch64SMETypeAttributes : unsigned {
SME_NormalFunction = 0 , SME_PStateSMEnabledMask = 1 << 0 , SME_PStateSMCompatibleMask = 1 << 1 , SME_ZAShift = 2 ,
SME_ZAMask = 0b111 << SME_ZAShift , SME_ZT0Shift = 5 , SME_ZT0Mask = 0b111 << SME_ZT0Shift , SME_AgnosticZAStateShift = 8 ,
SME_AgnosticZAStateMask = 1 << SME_AgnosticZAStateShift , SME_AttributeMask
}
The AArch64 SME ACLE (Arm C/C++ Language Extensions) define a number of function type attributes that can be set on function types, including function pointers. More...
enum
ArmStateValue : unsigned {
ARM_None = 0 , ARM_Preserves = 1 , ARM_In = 2 , ARM_Out = 3 ,
ARM_InOut = 4
}
Public Types inherited from clang::Type
enum
enum
ScalarTypeKind {
STK_CPointer, STK_BlockPointer, STK_ObjCObjectPointer, STK_MemberPointer,
STK_Bool, STK_Integral, STK_Floating, STK_IntegralComplex,
STK_FloatingComplex, STK_FixedPoint
}
Public Member Functions
getNumParams () const
getParamType (unsigned i) const
getParamTypes () const
getExtProtoInfo () const
getExceptionSpecType () const
Get the kind of exception specification on this function.
hasExceptionSpec () const
Return whether this function has any kind of exception spec.
hasDynamicExceptionSpec () const
Return whether this function has a dynamic (throw) exception spec.
hasNoexceptExceptionSpec () const
Return whether this function has a noexcept exception spec.
hasDependentExceptionSpec () const
Return whether this function has a dependent exception spec.
hasInstantiationDependentExceptionSpec () const
Return whether this function has an instantiation-dependent exception spec.
getExceptionSpecInfo () const
Return all the available information about this type's exception spec.
getNumExceptions () const
Return the number of types in the exception specification.
getExceptionType (unsigned i) const
Return the ith exception type, where 0 <= i < getNumExceptions().
Expr *
getNoexceptExpr () const
Return the expression inside noexcept(expression), or a null pointer if there is none (because the exception spec is not of this form).
getExceptionSpecDecl () const
If this function type has an exception specification which hasn't been determined yet (either because it has not been evaluated or because it has not been instantiated), this is the function whose exception specification is represented by this type.
getExceptionSpecTemplate () const
If this function type has an uninstantiated exception specification, this is the function whose exception specification should be instantiated to find the exception specification for this type.
canThrow () const
Determine whether this function type has a non-throwing exception specification.
isNothrow (bool ResultIfDependent=false) const
Determine whether this function type has a non-throwing exception specification.
isVariadic () const
Whether this function prototype is variadic.
getEllipsisLoc () const
isTemplateVariadic () const
Determines whether this function prototype contains a parameter pack at the end.
hasTrailingReturn () const
Whether this function prototype has a trailing return type.
getMethodQuals () const
getRefQualifier () const
Retrieve the ref-qualifier associated with this function type.
param_types () const
param_type_begin () const
param_type_end () const
exceptions () const
exception_begin () const
exception_end () const
hasExtParameterInfos () const
Is there any interesting extra information for any of the parameters of this function type?
getExtParameterInfos () const
const ExtParameterInfo *
getExtParameterInfosOrNull () const
Return a pointer to the beginning of the array of extra parameter information, if present, or else null if none of the parameters carry it.
getAArch64SMEAttributes () const
Return a bitmask describing the SME attributes on the function type, see AArch64SMETypeAttributes for their values.
getExtParameterInfo (unsigned I) const
getParameterABI (unsigned I) const
isParamConsumed (unsigned I) const
getNumFunctionEffects () const
getFunctionEffectsWithoutConditions () const
getNumFunctionEffectConditions () const
ArrayRef< EffectConditionExpr >
getFunctionEffectConditions () const
getFunctionEffects () const
isSugared () const
desugar () const
void
printExceptionSpecification (raw_ostream &OS, const PrintingPolicy &Policy) const
void
Profile (llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
Public Member Functions inherited from clang::FunctionType
getReturnType () const
getHasRegParm () const
getRegParmType () const
getNoReturnAttr () const
Determine whether this function type includes the GNU noreturn attribute.
getCmseNSCallAttr () const
getCallConv () const
getExtInfo () const
isConst () const
isVolatile () const
isRestrict () const
getCallResultType (const ASTContext &Context) const
Determine the type of an expression that calls a function of this type.
Public Member Functions inherited from clang::Type
Type &
operator= (const Type &)=delete
Type &
getTypeClass () const
isFromAST () const
Whether this type comes from an AST file.
containsUnexpandedParameterPack () const
Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templates.
isCanonicalUnqualified () const
Determines if this type would be canonical if it had no further qualification.
getLocallyUnqualifiedSingleStepDesugaredType () const
Pull a single level of sugar off of this locally-unqualified type.
isSizelessType () const
As an extension, we classify types as one of "sized" or "sizeless"; every type is one or the other.
isSizelessBuiltinType () const
isSizelessVectorType () const
Returns true for all scalable vector types.
isSVESizelessBuiltinType () const
Returns true for SVE scalable vector types.
isRVVSizelessBuiltinType () const
Returns true for RVV scalable vector types.
isWebAssemblyExternrefType () const
Check if this is a WebAssembly Externref Type.
isWebAssemblyTableType () const
Returns true if this is a WebAssembly table type: either an array of reference types, or a pointer to a reference type (which can only be created by array to pointer decay).
isSveVLSBuiltinType () const
Determines if this is a sizeless type supported by the 'arm_sve_vector_bits' type attribute, which can be applied to a single SVE vector or predicate, excluding tuple types such as svint32x4_t.
getSveEltType (const ASTContext &Ctx) const
Returns the representative type for the element of an SVE builtin type.
isRVVVLSBuiltinType () const
Determines if this is a sizeless type supported by the 'riscv_rvv_vector_bits' type attribute, which can be applied to a single RVV vector or mask.
getRVVEltType (const ASTContext &Ctx) const
Returns the representative type for the element of an RVV builtin type.
getSizelessVectorEltType (const ASTContext &Ctx) const
Returns the representative type for the element of a sizeless vector builtin type.
isIncompleteType (NamedDecl **Def=nullptr) const
Types are partitioned into 3 broad categories (C99 6.2.5p1): object types, function types, and incomplete types.
isIncompleteOrObjectType () const
Return true if this is an incomplete or object type, in other words, not a function type.
isObjectType () const
Determine whether this type is an object type.
isLiteralType (const ASTContext &Ctx) const
Return true if this is a literal type (C++11 [basic.types]p10)
isStructuralType () const
Determine if this type is a structural type, per C++20 [temp.param]p7.
isStandardLayoutType () const
Test if this type is a standard-layout type.
isBuiltinType () const
Helper methods to distinguish type categories.
isSpecificBuiltinType (unsigned K) const
Test for a particular builtin type.
isPlaceholderType () const
Test for a type which does not represent an actual type-system type but is instead used as a placeholder for various convenient purposes within Clang.
const BuiltinType *
getAsPlaceholderType () const
isSpecificPlaceholderType (unsigned K) const
Test for a specific placeholder type.
isNonOverloadPlaceholderType () const
Test for a placeholder type other than Overload; see BuiltinType::isNonOverloadPlaceholderType.
isIntegerType () const
isIntegerType() does not include complex integers (a GCC extension).
isEnumeralType () const
isScopedEnumeralType () const
Determine whether this type is a scoped enumeration type.
isBooleanType () const
isCharType () const
isWideCharType () const
isChar8Type () const
isChar16Type () const
isChar32Type () const
isAnyCharacterType () const
Determine whether this type is any of the built-in character types.
isIntegralType (const ASTContext &Ctx) const
Determine whether this type is an integral type.
isIntegralOrEnumerationType () const
Determine whether this type is an integral or enumeration type.
isIntegralOrUnscopedEnumerationType () const
Determine whether this type is an integral or unscoped enumeration type.
isUnscopedEnumerationType () const
isRealFloatingType () const
Floating point categories.
isComplexType () const
isComplexType() does not include complex integers (a GCC extension).
isAnyComplexType () const
isFloatingType () const
isHalfType () const
isFloat16Type () const
isFloat32Type () const
isDoubleType () const
isBFloat16Type () const
isFloat128Type () const
isIbm128Type () const
isRealType () const
isArithmeticType () const
isVoidType () const
isScalarType () const
isAggregateType () const
Determines whether the type is a C++ aggregate type or C aggregate or union type.
isFundamentalType () const
Tests whether the type is categorized as a fundamental type.
isCompoundType () const
Tests whether the type is categorized as a compound type.
isFunctionType () const
isFunctionNoProtoType () const
isFunctionProtoType () const
isPointerType () const
isPointerOrReferenceType () const
isSignableType () const
isAnyPointerType () const
isCountAttributedType () const
isBlockPointerType () const
isVoidPointerType () const
isReferenceType () const
isLValueReferenceType () const
isRValueReferenceType () const
isObjectPointerType () const
isFunctionPointerType () const
isFunctionReferenceType () const
isMemberPointerType () const
isMemberFunctionPointerType () const
isMemberDataPointerType () const
isArrayType () const
isConstantArrayType () const
isIncompleteArrayType () const
isVariableArrayType () const
isArrayParameterType () const
isDependentSizedArrayType () const
isRecordType () const
isClassType () const
isStructureType () const
isStructureTypeWithFlexibleArrayMember () const
isObjCBoxableRecordType () const
isInterfaceType () const
isStructureOrClassType () const
isUnionType () const
isComplexIntegerType () const
isVectorType () const
isExtVectorType () const
isExtVectorBoolType () const
isSubscriptableVectorType () const
isMatrixType () const
isConstantMatrixType () const
isDependentAddressSpaceType () const
isObjCObjectPointerType () const
isObjCRetainableType () const
isObjCLifetimeType () const
Returns true if objects of this type have lifetime semantics under ARC.
isObjCIndirectLifetimeType () const
isObjCNSObjectType () const
isObjCIndependentClassType () const
isObjCObjectType () const
isObjCQualifiedInterfaceType () const
isObjCQualifiedIdType () const
isObjCQualifiedClassType () const
isObjCObjectOrInterfaceType () const
isObjCIdType () const
isDecltypeType () const
isObjCInertUnsafeUnretainedType () const
Was this type written with the special inert-in-ARC __unsafe_unretained qualifier?
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 __kindof id .
isObjCClassType () const
isObjCClassOrClassKindOfType () const
Whether the type is Objective-C 'Class' or a __kindof type of an Class type, e.g., __kindof Class .
isBlockCompatibleObjCPointerType (ASTContext &ctx) const
isObjCSelType () const
isObjCBuiltinType () const
isObjCARCBridgableType () const
Determine whether the given type T is a "bridgable" Objective-C type, which is either an Objective-C object pointer type or an.
isCARCBridgableType () const
Determine whether the given type T is a "bridgeable" C type.
isTemplateTypeParmType () const
isNullPtrType () const
isNothrowT () const
isAlignValT () const
isStdByteType () const
isAtomicType () const
isUndeducedAutoType () const
isTypedefNameType () const
Determines whether this type is written as a typedef-name.
isImageType () const
isSamplerT () const
isEventT () const
isClkEventT () const
isQueueT () const
isReserveIDT () const
isOCLIntelSubgroupAVCType () const
isOCLExtOpaqueType () const
isPipeType () const
isBitIntType () const
isOpenCLSpecificType () const
isHLSLSpecificType () const
isHLSLBuiltinIntangibleType () const
isHLSLAttributedResourceType () const
isHLSLIntangibleType () const
isObjCARCImplicitlyUnretainedType () const
Determines if this type, which must satisfy isObjCLifetimeType(), is implicitly __unsafe_unretained rather than implicitly __strong.
isCUDADeviceBuiltinSurfaceType () const
Check if the type is the CUDA device builtin surface type.
isCUDADeviceBuiltinTextureType () const
Check if the type is the CUDA device builtin texture type.
getObjCARCImplicitLifetime () const
Return the implicit lifetime for this type, which must not be dependent.
getScalarTypeKind () const
Given that this is a scalar type, classify it.
getDependence () const
containsErrors () const
Whether this type is an error type.
isDependentType () const
Whether this type is a dependent type, meaning that its definition somehow depends on a template parameter (C++ [temp.dep.type]).
isInstantiationDependentType () const
Determine whether this type is an instantiation-dependent type, meaning that the type involves a template parameter (even if the definition does not actually depend on the type substituted for that template parameter).
isUndeducedType () const
Determine whether this type is an undeduced type, meaning that it somehow involves a C++11 'auto' type or similar which has not yet been deduced.
isVariablyModifiedType () const
Whether this type is a variably-modified type (C99 6.7.5).
hasSizedVLAType () const
Whether this type involves a variable-length array type with a definite size.
hasUnnamedOrLocalType () const
Whether this type is or contains a local or unnamed type.
isOverloadableType () const
Determines whether this is a type for which one can define an overloaded operator.
isElaboratedTypeSpecifier () const
Determine wither this type is a C++ elaborated-type-specifier.
canDecayToPointerType () const
Determines whether this type can decay to a pointer type.
hasPointerRepresentation () const
Whether this type is represented natively as a pointer.
hasObjCPointerRepresentation () const
Whether this type can represent an objective pointer type for the purpose of GC'ability.
hasIntegerRepresentation () const
Determine whether this type has an integer representation of some sort, e.g., it is an integer type or a vector.
hasSignedIntegerRepresentation () const
Determine whether this type has an signed integer representation of some sort, e.g., it is an signed integer type or a vector.
hasUnsignedIntegerRepresentation () const
Determine whether this type has an unsigned integer representation of some sort, e.g., it is an unsigned integer type or a vector.
hasFloatingRepresentation () const
Determine whether this type has a floating-point representation of some sort, e.g., it is a floating-point type or a vector thereof.
const RecordType *
getAsStructureType () const
const RecordType *
getAsUnionType () const
NOTE: getAs*ArrayType are methods on ASTContext.
const ComplexType *
getAsComplexIntegerType () const
const ObjCObjectType *
getAsObjCInterfaceType () const
const ObjCObjectPointerType *
getAsObjCInterfacePointerType () const
const ObjCObjectPointerType *
getAsObjCQualifiedIdType () const
const ObjCObjectPointerType *
getAsObjCQualifiedClassType () const
const ObjCObjectType *
getAsObjCQualifiedInterfaceType () const
getAsCXXRecordDecl () const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or because it is the injected-class-name type of a class template or class template partial specialization.
getAsRecordDecl () const
Retrieves the RecordDecl this type refers to.
TagDecl *
getAsTagDecl () const
Retrieves the TagDecl that this type refers to, either because the type is a TagType or because it is the injected-class-name type of a class template or class template partial specialization.
const CXXRecordDecl *
getPointeeCXXRecordDecl () const
If this is a pointer or reference to a RecordType, return the CXXRecordDecl that the type refers to.
getContainedDeducedType () const
Get the DeducedType whose type will be deduced for a variable with an initializer of this type.
AutoType *
getContainedAutoType () const
Get the AutoType whose type will be deduced for a variable with an initializer of this type.
hasAutoForTrailingReturnType () const
Determine whether this type was written with a leading 'auto' corresponding to a trailing return type (possibly for a nested function type within a pointer to function type or similar).
template<typename T >
const T *
getAs () const
Member-template getAs'.
template<typename T >
const T *
getAsAdjusted () const
Member-template getAsAdjusted.
const ArrayType *
getAsArrayTypeUnsafe () const
A variant of getAs<> for array types which silently discards qualifiers from the outermost type.
template<typename T >
const T *
castAs () const
Member-template castAs.
const ArrayType *
castAsArrayTypeUnsafe () const
A variant of castAs<> for array type which silently discards qualifiers from the outermost type.
hasAttr (attr::Kind AK) const
Determine whether this type had the specified attribute applied to it (looking through top-level type sugar).
const Type *
getBaseElementTypeUnsafe () const
Get the base element type of this type, potentially discarding type qualifiers.
const Type *
getArrayElementTypeNoTypeQual () const
If this is an array type, return the element type of the array, potentially with type qualifiers missing.
const Type *
getPointeeOrArrayElementType () const
If this is a pointer type, return the pointee type.
getPointeeType () const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
const Type *
getUnqualifiedDesugaredType () const
Return the specified type with any "sugar" removed from the type, removing any typedefs, typeofs, etc., as well as any qualifiers.
isSignedIntegerType () const
Return true if this is an integer type that is signed, according to C99 6.2.5p4 [char, signed char, short, int, long..], or an enum decl which has a signed representation.
isUnsignedIntegerType () const
Return true if this is an integer type that is unsigned, according to C99 6.2.5p6 [which returns true for _Bool], or an enum decl which has an unsigned representation.
isSignedIntegerOrEnumerationType () const
Determines whether this is an integer type that is signed or an enumeration types whose underlying type is a signed integer type.
isUnsignedIntegerOrEnumerationType () const
Determines whether this is an integer type that is unsigned or an enumeration types whose underlying type is a unsigned integer type.
isFixedPointType () const
Return true if this is a fixed point type according to ISO/IEC JTC1 SC22 WG14 N1169.
isFixedPointOrIntegerType () const
Return true if this is a fixed point or integer type.
isConvertibleToFixedPointType () const
Return true if this can be converted to (or from) a fixed point type.
isSaturatedFixedPointType () const
Return true if this is a saturated fixed point type according to ISO/IEC JTC1 SC22 WG14 N1169.
isUnsaturatedFixedPointType () const
Return true if this is a saturated fixed point type according to ISO/IEC JTC1 SC22 WG14 N1169.
isSignedFixedPointType () const
Return true if this is a fixed point type that is signed according to ISO/IEC JTC1 SC22 WG14 N1169.
isUnsignedFixedPointType () const
Return true if this is a fixed point type that is unsigned according to ISO/IEC JTC1 SC22 WG14 N1169.
isConstantSizeType () const
Return true if this is not a variable sized type, according to the rules of C99 6.7.5p3.
isSpecifierType () const
Returns true if this type can be represented by some set of type specifiers.
getLinkage () const
Determine the linkage of this type.
getVisibility () const
Determine the visibility of this type.
isVisibilityExplicit () const
Return true if the visibility was explicitly set is the code.
getLinkageAndVisibility () const
Determine the linkage and visibility of this type.
isLinkageValid () const
True if the computed linkage is valid.
std::optional< NullabilityKind >
getNullability () const
Determine the nullability of the given type.
canHaveNullability (bool ResultIfUnknown=true) const
Determine whether the given type can have a nullability specifier applied to it, i.e., if it is any kind of pointer type.
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 that is declared in the given context.
acceptsObjCTypeParams () const
Determines if this is an ObjC interface type that may accept type parameters.
const char *
getTypeClassName () const
getCanonicalTypeInternal () const
getCanonicalTypeUnqualified () const
void
dump () const
void
dump (llvm::raw_ostream &OS, const ASTContext &Context) const
template<>
const TypedefType *
getAs () const
This will check for a TypedefType by removing any existing sugar until it reaches a TypedefType or a non-sugared type.
Represents a prototype with parameter type info, e.g.
'int foo(int)' or 'int foo(void)'. 'void' is represented as having no parameters, not as having a single void parameter. Such a type can have an exception specification, but this specification is not part of the canonical type. FunctionProtoType has several trailing objects, some of which optional. For more information about the trailing objects see the first comment inside FunctionProtoType.