clang 22.0.0git
clang::FunctionProtoType Class Referencefinal

Represents a prototype with parameter type info, e.g. More...

#include "clang/AST/TypeBase.h"

Inheritance diagram for clang::FunctionProtoType:
[legend]

Classes

struct  ExceptionSpecInfo
 Holds information about the various types of exception specification. More...
struct  ExtProtoInfo
 Extra information about a function prototype. More...

Public Types

using param_type_iterator = const QualType *
using exception_iterator = const QualType *
Public Types inherited from clang::FunctionType
enum  AArch64SMETypeAttributes : uint16_t {
  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  TypeClass
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

unsigned getNumParams () const
QualType getParamType (unsigned i) const
ArrayRef< QualTypegetParamTypes () const
ExtProtoInfo getExtProtoInfo () const
ExceptionSpecificationType getExceptionSpecType () const
 Get the kind of exception specification on this function.
bool hasExceptionSpec () const
 Return whether this function has any kind of exception spec.
bool hasDynamicExceptionSpec () const
 Return whether this function has a dynamic (throw) exception spec.
bool hasNoexceptExceptionSpec () const
 Return whether this function has a noexcept exception spec.
bool hasDependentExceptionSpec () const
 Return whether this function has a dependent exception spec.
bool hasInstantiationDependentExceptionSpec () const
 Return whether this function has an instantiation-dependent exception spec.
ExceptionSpecInfo getExceptionSpecInfo () const
 Return all the available information about this type's exception spec.
unsigned getNumExceptions () const
 Return the number of types in the exception specification.
QualType getExceptionType (unsigned i) const
 Return the ith exception type, where 0 <= i < getNumExceptions().
ExprgetNoexceptExpr () const
 Return the expression inside noexcept(expression), or a null pointer if there is none (because the exception spec is not of this form).
FunctionDeclgetExceptionSpecDecl () 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.
FunctionDeclgetExceptionSpecTemplate () 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.
CanThrowResult canThrow () const
 Determine whether this function type has a non-throwing exception specification.
bool isNothrow (bool ResultIfDependent=false) const
 Determine whether this function type has a non-throwing exception specification.
bool isVariadic () const
 Whether this function prototype is variadic.
SourceLocation getEllipsisLoc () const
bool isTemplateVariadic () const
 Determines whether this function prototype contains a parameter pack at the end.
bool hasTrailingReturn () const
 Whether this function prototype has a trailing return type.
bool hasCFIUncheckedCallee () const
Qualifiers getMethodQuals () const
RefQualifierKind getRefQualifier () const
 Retrieve the ref-qualifier associated with this function type.
ArrayRef< QualTypeparam_types () const
param_type_iterator param_type_begin () const
param_type_iterator param_type_end () const
ArrayRef< QualTypeexceptions () const
exception_iterator exception_begin () const
exception_iterator exception_end () const
bool hasExtParameterInfos () const
 Is there any interesting extra information for any of the parameters of this function type?
ArrayRef< ExtParameterInfogetExtParameterInfos () const
const ExtParameterInfogetExtParameterInfosOrNull () 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.
FunctionTypeExtraAttributeInfo getExtraAttributeInfo () const
 Return the extra attribute information.
unsigned getAArch64SMEAttributes () const
 Return a bitmask describing the SME attributes on the function type, see AArch64SMETypeAttributes for their values.
ExtParameterInfo getExtParameterInfo (unsigned I) const
ParameterABI getParameterABI (unsigned I) const
bool isParamConsumed (unsigned I) const
unsigned getNumFunctionEffects () const
ArrayRef< FunctionEffectgetFunctionEffectsWithoutConditions () const
unsigned getNumFunctionEffectConditions () const
ArrayRef< EffectConditionExprgetFunctionEffectConditions () const
FunctionEffectsRef getFunctionEffects () const
bool isSugared () const
QualType 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
QualType getReturnType () const
bool getHasRegParm () const
unsigned getRegParmType () const
bool getNoReturnAttr () const
 Determine whether this function type includes the GNU noreturn attribute.
bool getCFIUncheckedCalleeAttr () const
 Determine whether this is a function prototype that includes the cfi_unchecked_callee attribute.
bool getCmseNSCallAttr () const
CallingConv getCallConv () const
ExtInfo getExtInfo () const
bool isConst () const
bool isVolatile () const
bool isRestrict () const
QualType 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 (const Type &)=delete
 Type (Type &&)=delete
Typeoperator= (const Type &)=delete
Typeoperator= (Type &&)=delete
TypeClass getTypeClass () const
bool isFromAST () const
 Whether this type comes from an AST file.
bool containsUnexpandedParameterPack () const
 Whether this type is or contains an unexpanded parameter pack, used to support C++0x variadic templates.
bool isCanonicalUnqualified () const
 Determines if this type would be canonical if it had no further qualification.
QualType getLocallyUnqualifiedSingleStepDesugaredType () const
 Pull a single level of sugar off of this locally-unqualified type.
bool isSizelessType () const
 As an extension, we classify types as one of "sized" or "sizeless"; every type is one or the other.
bool isSizelessBuiltinType () const
bool isSizelessVectorType () const
 Returns true for all scalable vector types.
bool isSVESizelessBuiltinType () const
 Returns true for SVE scalable vector types.
bool isRVVSizelessBuiltinType () const
 Returns true for RVV scalable vector types.
bool isWebAssemblyExternrefType () const
 Check if this is a WebAssembly Externref Type.
bool 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).
bool 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.
QualType getSveEltType (const ASTContext &Ctx) const
 Returns the representative type for the element of an SVE builtin type.
bool 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.
QualType getRVVEltType (const ASTContext &Ctx) const
 Returns the representative type for the element of an RVV builtin type.
QualType getSizelessVectorEltType (const ASTContext &Ctx) const
 Returns the representative type for the element of a sizeless vector builtin type.
bool isIncompleteType (NamedDecl **Def=nullptr) const
 Types are partitioned into 3 broad categories (C99 6.2.5p1): object types, function types, and incomplete types.
bool isIncompleteOrObjectType () const
 Return true if this is an incomplete or object type, in other words, not a function type.
bool isAlwaysIncompleteType () const
bool isObjectType () const
 Determine whether this type is an object type.
bool isLiteralType (const ASTContext &Ctx) const
 Return true if this is a literal type (C++11 [basic.types]p10)
bool isStructuralType () const
 Determine if this type is a structural type, per C++20 [temp.param]p7.
bool isStandardLayoutType () const
 Test if this type is a standard-layout type.
bool isBuiltinType () const
 Helper methods to distinguish type categories.
bool isSpecificBuiltinType (unsigned K) const
 Test for a particular builtin type.
bool 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 BuiltinTypegetAsPlaceholderType () const
bool isSpecificPlaceholderType (unsigned K) const
 Test for a specific placeholder type.
bool isNonOverloadPlaceholderType () const
 Test for a placeholder type other than Overload; see BuiltinType::isNonOverloadPlaceholderType.
bool isIntegerType () const
 isIntegerType() does not include complex integers (a GCC extension).
bool isEnumeralType () const
bool isScopedEnumeralType () const
 Determine whether this type is a scoped enumeration type.
bool isBooleanType () const
bool isCharType () const
bool isWideCharType () const
bool isChar8Type () const
bool isChar16Type () const
bool isChar32Type () const
bool isAnyCharacterType () const
 Determine whether this type is any of the built-in character types.
bool isUnicodeCharacterType () const
bool isIntegralType (const ASTContext &Ctx) const
 Determine whether this type is an integral type.
bool isIntegralOrEnumerationType () const
 Determine whether this type is an integral or enumeration type.
bool isIntegralOrUnscopedEnumerationType () const
 Determine whether this type is an integral or unscoped enumeration type.
bool isUnscopedEnumerationType () const
bool isRealFloatingType () const
 Floating point categories.
bool isComplexType () const
 isComplexType() does not include complex integers (a GCC extension).
bool isAnyComplexType () const
bool isFloatingType () const
bool isHalfType () const
bool isFloat16Type () const
bool isFloat32Type () const
bool isDoubleType () const
bool isBFloat16Type () const
bool isMFloat8Type () const
bool isFloat128Type () const
bool isIbm128Type () const
bool isRealType () const
bool isArithmeticType () const
bool isVoidType () const
bool isScalarType () const
bool isAggregateType () const
 Determines whether the type is a C++ aggregate type or C aggregate or union type.
bool isFundamentalType () const
 Tests whether the type is categorized as a fundamental type.
bool isCompoundType () const
 Tests whether the type is categorized as a compound type.
bool isFunctionType () const
bool isFunctionNoProtoType () const
bool isFunctionProtoType () const
bool isPointerType () const
bool isPointerOrReferenceType () const
bool isSignableType (const ASTContext &Ctx) const
bool isSignablePointerType () const
bool isSignableIntegerType (const ASTContext &Ctx) const
bool isAnyPointerType () const
bool isCountAttributedType () const
bool isCFIUncheckedCalleeFunctionType () const
bool hasPointeeToToCFIUncheckedCalleeFunctionType () const
bool isBlockPointerType () const
bool isVoidPointerType () const
bool isReferenceType () const
bool isLValueReferenceType () const
bool isRValueReferenceType () const
bool isObjectPointerType () const
bool isFunctionPointerType () const
bool isFunctionReferenceType () const
bool isMemberPointerType () const
bool isMemberFunctionPointerType () const
bool isMemberDataPointerType () const
bool isArrayType () const
bool isConstantArrayType () const
bool isIncompleteArrayType () const
bool isVariableArrayType () const
bool isArrayParameterType () const
bool isDependentSizedArrayType () const
bool isRecordType () const
bool isClassType () const
bool isStructureType () const
bool isStructureTypeWithFlexibleArrayMember () const
bool isObjCBoxableRecordType () const
bool isInterfaceType () const
bool isStructureOrClassType () const
bool isUnionType () const
bool isComplexIntegerType () const
bool isVectorType () const
bool isExtVectorType () const
bool isExtVectorBoolType () const
bool isPackedVectorBoolType (const ASTContext &ctx) const
bool isSubscriptableVectorType () const
bool isMatrixType () const
bool isConstantMatrixType () const
bool isDependentAddressSpaceType () const
bool isObjCObjectPointerType () const
bool isObjCRetainableType () const
bool isObjCLifetimeType () const
 Returns true if objects of this type have lifetime semantics under ARC.
bool isObjCIndirectLifetimeType () const
bool isObjCNSObjectType () const
bool isObjCIndependentClassType () const
bool isObjCObjectType () const
bool isObjCQualifiedInterfaceType () const
bool isObjCQualifiedIdType () const
bool isObjCQualifiedClassType () const
bool isObjCObjectOrInterfaceType () const
bool isObjCIdType () const
bool isDecltypeType () const
bool isObjCInertUnsafeUnretainedType () const
 Was this type written with the special inert-in-ARC __unsafe_unretained qualifier?
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 __kindof id <NSCopying>.
bool isObjCClassType () const
bool isObjCClassOrClassKindOfType () const
 Whether the type is Objective-C 'Class' or a __kindof type of an Class type, e.g., __kindof Class <NSCopying>.
bool isBlockCompatibleObjCPointerType (ASTContext &ctx) const
bool isObjCSelType () const
bool isObjCBuiltinType () const
bool 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.
bool isCARCBridgableType () const
 Determine whether the given type T is a "bridgeable" C type.
bool isTemplateTypeParmType () const
bool isNullPtrType () const
bool isNothrowT () const
bool isAlignValT () const
bool isStdByteType () const
bool isAtomicType () const
bool isUndeducedAutoType () const
bool isTypedefNameType () const
 Determines whether this type is written as a typedef-name.
bool isImageType () const
bool isSamplerT () const
bool isEventT () const
bool isClkEventT () const
bool isQueueT () const
bool isReserveIDT () const
bool isOCLIntelSubgroupAVCType () const
bool isOCLExtOpaqueType () const
bool isPipeType () const
bool isBitIntType () const
bool isOpenCLSpecificType () const
bool isHLSLSpecificType () const
bool isHLSLBuiltinIntangibleType () const
bool isHLSLAttributedResourceType () const
bool isHLSLInlineSpirvType () const
bool isHLSLResourceRecord () const
bool isHLSLResourceRecordArray () const
bool isHLSLIntangibleType () const
bool isObjCARCImplicitlyUnretainedType () const
 Determines if this type, which must satisfy isObjCLifetimeType(), is implicitly __unsafe_unretained rather than implicitly __strong.
bool isCUDADeviceBuiltinSurfaceType () const
 Check if the type is the CUDA device builtin surface type.
bool isCUDADeviceBuiltinTextureType () const
 Check if the type is the CUDA device builtin texture type.
Qualifiers::ObjCLifetime getObjCARCImplicitLifetime () const
 Return the implicit lifetime for this type, which must not be dependent.
ScalarTypeKind getScalarTypeKind () const
 Given that this is a scalar type, classify it.
TypeDependence getDependence () const
bool containsErrors () const
 Whether this type is an error type.
bool isDependentType () const
 Whether this type is a dependent type, meaning that its definition somehow depends on a template parameter (C++ [temp.dep.type]).
bool 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).
bool 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.
bool isVariablyModifiedType () const
 Whether this type is a variably-modified type (C99 6.7.5).
bool hasSizedVLAType () const
 Whether this type involves a variable-length array type with a definite size.
bool hasUnnamedOrLocalType () const
 Whether this type is or contains a local or unnamed type.
bool isOverloadableType () const
 Determines whether this is a type for which one can define an overloaded operator.
bool isElaboratedTypeSpecifier () const
 Determine wither this type is a C++ elaborated-type-specifier.
bool canDecayToPointerType () const
 Determines whether this type can decay to a pointer type.
bool hasPointerRepresentation () const
 Whether this type is represented natively as a pointer.
bool hasObjCPointerRepresentation () const
 Whether this type can represent an objective pointer type for the purpose of GC'ability.
bool hasIntegerRepresentation () const
 Determine whether this type has an integer representation of some sort, e.g., it is an integer type or a vector.
bool 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.
bool 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.
bool 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.
bool hasBooleanRepresentation () const
 Determine whether this type has a boolean representation – i.e., it is a boolean type, an enum type whose underlying type is a boolean type, or a vector of booleans.
const RecordType * getAsStructureType () const
const RecordType * getAsUnionType () const
 NOTE: getAs*ArrayType are methods on ASTContext.
const ComplexTypegetAsComplexIntegerType () const
const ObjCObjectTypegetAsObjCInterfaceType () const
const ObjCObjectPointerTypegetAsObjCInterfacePointerType () const
const ObjCObjectPointerTypegetAsObjCQualifiedIdType () const
const ObjCObjectPointerTypegetAsObjCQualifiedClassType () const
const ObjCObjectTypegetAsObjCQualifiedInterfaceType () const
CXXRecordDeclgetAsCXXRecordDecl () 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.
CXXRecordDeclcastAsCXXRecordDecl () const
RecordDeclgetAsRecordDecl () const
 Retrieves the RecordDecl this type refers to.
RecordDeclcastAsRecordDecl () const
EnumDeclgetAsEnumDecl () const
 Retrieves the EnumDecl this type refers to.
EnumDeclcastAsEnumDecl () const
TagDeclgetAsTagDecl () 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.
TagDeclcastAsTagDecl () const
const CXXRecordDeclgetPointeeCXXRecordDecl () const
 If this is a pointer or reference to a RecordType, return the CXXRecordDecl that the type refers to.
DeducedType * 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.
bool 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 TgetAs () const
 Member-template getAs<specific type>'.
template<typename T>
const TgetAsCanonical () const
 If this type is canonically the specified type, return its canonical type cast to that specified type, otherwise returns null.
template<typename T>
const TcastAsCanonical () const
 Return this type's canonical type cast to the specified type.
const TemplateSpecializationType * getAsNonAliasTemplateSpecializationType () const
 Look through sugar for an instance of TemplateSpecializationType which is not a type alias, or null if there is no such type.
const TemplateSpecializationType * castAsNonAliasTemplateSpecializationType () const
template<typename T>
const TgetAsAdjusted () const
 Member-template getAsAdjusted<specific type>.
const ArrayTypegetAsArrayTypeUnsafe () const
 A variant of getAs<> for array types which silently discards qualifiers from the outermost type.
template<typename T>
const TcastAs () const
 Member-template castAs<specific type>.
const ArrayTypecastAsArrayTypeUnsafe () const
 A variant of castAs<> for array type which silently discards qualifiers from the outermost type.
NestedNameSpecifier getPrefix () const
 If this type represents a qualified-id, this returns its nested name specifier.
bool hasAttr (attr::Kind AK) const
 Determine whether this type had the specified attribute applied to it (looking through top-level type sugar).
const TypegetBaseElementTypeUnsafe () const
 Get the base element type of this type, potentially discarding type qualifiers.
const TypegetArrayElementTypeNoTypeQual () const
 If this is an array type, return the element type of the array, potentially with type qualifiers missing.
const TypegetPointeeOrArrayElementType () const
 If this is a pointer type, return the pointee type.
QualType getPointeeType () const
 If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
const TypegetUnqualifiedDesugaredType () const
 Return the specified type with any "sugar" removed from the type, removing any typedefs, typeofs, etc., as well as any qualifiers.
bool 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.
bool 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.
bool isSignedIntegerOrEnumerationType () const
 Determines whether this is an integer type that is signed or an enumeration types whose underlying type is a signed integer type.
bool isUnsignedIntegerOrEnumerationType () const
 Determines whether this is an integer type that is unsigned or an enumeration types whose underlying type is a unsigned integer type.
bool isFixedPointType () const
 Return true if this is a fixed point type according to ISO/IEC JTC1 SC22 WG14 N1169.
bool isFixedPointOrIntegerType () const
 Return true if this is a fixed point or integer type.
bool isConvertibleToFixedPointType () const
 Return true if this can be converted to (or from) a fixed point type.
bool isSaturatedFixedPointType () const
 Return true if this is a saturated fixed point type according to ISO/IEC JTC1 SC22 WG14 N1169.
bool isUnsaturatedFixedPointType () const
 Return true if this is a saturated fixed point type according to ISO/IEC JTC1 SC22 WG14 N1169.
bool isSignedFixedPointType () const
 Return true if this is a fixed point type that is signed according to ISO/IEC JTC1 SC22 WG14 N1169.
bool isUnsignedFixedPointType () const
 Return true if this is a fixed point type that is unsigned according to ISO/IEC JTC1 SC22 WG14 N1169.
bool isConstantSizeType () const
 Return true if this is not a variable sized type, according to the rules of C99 6.7.5p3.
bool isSpecifierType () const
 Returns true if this type can be represented by some set of type specifiers.
Linkage getLinkage () const
 Determine the linkage of this type.
Visibility getVisibility () const
 Determine the visibility of this type.
bool isVisibilityExplicit () const
 Return true if the visibility was explicitly set is the code.
LinkageInfo getLinkageAndVisibility () const
 Determine the linkage and visibility of this type.
bool isLinkageValid () const
 True if the computed linkage is valid.
std::optional< NullabilityKindgetNullability () const
 Determine the nullability of the given type.
bool 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.
bool acceptsObjCTypeParams () const
 Determines if this is an ObjC interface type that may accept type parameters.
const char * getTypeClassName () const
QualType getCanonicalTypeInternal () const
CanQualType getCanonicalTypeUnqualified () const
void dump () const
void dump (llvm::raw_ostream &OS, const ASTContext &Context) const
template<>
const TypedefTypegetAs () const
 This will check for a TypedefType by removing any existing sugar until it reaches a TypedefType or a non-sugared type.
template<>
const UsingTypegetAs () const
template<>
const TemplateSpecializationType * getAs () const
 This will check for a TemplateSpecializationType by removing any existing sugar until it reaches a TemplateSpecializationType or a non-sugared type.
template<>
const AttributedType * getAs () const
 This will check for an AttributedType by removing any existing sugar until it reaches an AttributedType or a non-sugared type.
template<>
const BoundsAttributedTypegetAs () const
 This will check for a BoundsAttributedType by removing any existing sugar until it reaches an BoundsAttributedType or a non-sugared type.
template<>
const CountAttributedTypegetAs () const
 This will check for a CountAttributedType by removing any existing sugar until it reaches an CountAttributedType or a non-sugared type.
template<>
const TypedefTypegetAs () const
template<>
const UsingTypegetAs () const
template<>
const TemplateSpecializationType * getAs () const
template<>
const AttributedType * getAs () const
template<>
const BoundsAttributedTypegetAs () const
template<>
const CountAttributedTypegetAs () const

Static Public Member Functions

static bool classof (const Type *T)
static void Profile (llvm::FoldingSetNodeID &ID, QualType Result, param_type_iterator ArgTys, unsigned NumArgs, const ExtProtoInfo &EPI, const ASTContext &Context, bool Canonical)
Static Public Member Functions inherited from clang::FunctionType
static ArmStateValue getArmZAState (unsigned AttrBits)
static ArmStateValue getArmZT0State (unsigned AttrBits)
static StringRef getNameForCallConv (CallingConv CC)
static bool classof (const Type *T)

Friends

class ASTContext

Additional Inherited Members

Static Public Attributes inherited from clang::Type
static constexpr int FunctionTypeNumParamsWidth = 16
static constexpr int FunctionTypeNumParamsLimit = (1 << 16) - 1
Protected Types inherited from clang::Type
enum  { NumArrayTypeBits = NumTypeBits + 6 }
enum  { NumTypeWithKeywordBits = NumTypeBits + 8 }
enum class  PredefinedSugarKind { SizeT , SignedSizeT , PtrdiffT , Last = PtrdiffT }
Protected Member Functions inherited from clang::FunctionType
 FunctionType (TypeClass tc, QualType res, QualType Canonical, TypeDependence Dependence, ExtInfo Info)
Qualifiers getFastTypeQuals () const
Protected Member Functions inherited from clang::Type
 Type (TypeClass tc, QualType canon, TypeDependence Dependence)
Typethis_ ()
void setDependence (TypeDependence D)
void addDependence (TypeDependence D)
Protected Attributes inherited from clang::Type
union { 
   TypeBitfields   TypeBits 
   ArrayTypeBitfields   ArrayTypeBits 
   ConstantArrayTypeBitfields   ConstantArrayTypeBits 
   AttributedTypeBitfields   AttributedTypeBits 
   AutoTypeBitfields   AutoTypeBits 
   TypeOfBitfields   TypeOfBits 
   TypedefBitfields   TypedefBits 
   UnresolvedUsingBitfields   UnresolvedUsingBits 
   UsingBitfields   UsingBits 
   BuiltinTypeBitfields   BuiltinTypeBits 
   FunctionTypeBitfields   FunctionTypeBits 
   ObjCObjectTypeBitfields   ObjCObjectTypeBits 
   ReferenceTypeBitfields   ReferenceTypeBits 
   KeywordWrapperBitfields   KeywordWrapperBits 
   TagTypeBitfields   TagTypeBits 
   VectorTypeBitfields   VectorTypeBits 
   TemplateTypeParmTypeBitfields   TemplateTypeParmTypeBits 
   SubstTemplateTypeParmTypeBitfields   SubstTemplateTypeParmTypeBits 
   SubstPackTypeBitfields   SubstPackTypeBits 
   TemplateSpecializationTypeBitfields   TemplateSpecializationTypeBits 
   DependentTemplateSpecializationTypeBitfields   DependentTemplateSpecializationTypeBits 
   PackExpansionTypeBitfields   PackExpansionTypeBits 
   CountAttributedTypeBitfields   CountAttributedTypeBits 
   PresefinedSugarTypeBitfields   PredefinedSugarTypeBits 
}; 

Detailed Description

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.

Definition at line 5273 of file TypeBase.h.

Member Typedef Documentation

◆ exception_iterator

Definition at line 5734 of file TypeBase.h.

◆ param_type_iterator

Definition at line 5720 of file TypeBase.h.

Member Function Documentation

◆ canThrow()

◆ classof()

bool clang::FunctionProtoType::classof ( const Type * T)
inlinestatic

Definition at line 5868 of file TypeBase.h.

References clang::T.

◆ desugar()

QualType clang::FunctionProtoType::desugar ( ) const
inline

Definition at line 5863 of file TypeBase.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitKCFIOperandBundle().

◆ exception_begin()

exception_iterator clang::FunctionProtoType::exception_begin ( ) const
inline

◆ exception_end()

exception_iterator clang::FunctionProtoType::exception_end ( ) const
inline

Definition at line 5745 of file TypeBase.h.

References exception_begin(), and getNumExceptions().

Referenced by exceptions().

◆ exceptions()

◆ getAArch64SMEAttributes()

unsigned clang::FunctionProtoType::getAArch64SMEAttributes ( ) const
inline

Return a bitmask describing the SME attributes on the function type, see AArch64SMETypeAttributes for their values.

Definition at line 5779 of file TypeBase.h.

References clang::FunctionType::SME_NormalFunction.

Referenced by AddAttributesFromFunctionProtoType(), clang::Sema::areMultiversionVariantFunctionsCompatible(), and getExtProtoInfo().

◆ getEllipsisLoc()

SourceLocation clang::FunctionProtoType::getEllipsisLoc ( ) const
inline

Definition at line 5688 of file TypeBase.h.

References isVariadic().

Referenced by clang::FunctionDecl::getEllipsisLoc(), and getExtProtoInfo().

◆ getExceptionSpecDecl()

FunctionDecl * clang::FunctionProtoType::getExceptionSpecDecl ( ) const
inline

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.

Definition at line 5657 of file TypeBase.h.

References clang::EST_Unevaluated, clang::EST_Uninstantiated, and getExceptionSpecType().

Referenced by getExceptionSpecInfo(), and clang::Sema::ResolveExceptionSpec().

◆ getExceptionSpecInfo()

ExceptionSpecInfo clang::FunctionProtoType::getExceptionSpecInfo ( ) const
inline

◆ getExceptionSpecTemplate()

FunctionDecl * clang::FunctionProtoType::getExceptionSpecTemplate ( ) const
inline

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.

Definition at line 5668 of file TypeBase.h.

References clang::EST_Uninstantiated, and getExceptionSpecType().

Referenced by getExceptionSpecInfo(), and clang::Sema::InstantiateExceptionSpec().

◆ getExceptionSpecType()

◆ getExceptionType()

QualType clang::FunctionProtoType::getExceptionType ( unsigned i) const
inline

Return the ith exception type, where 0 <= i < getNumExceptions().

Definition at line 5640 of file TypeBase.h.

References exception_begin(), and getNumExceptions().

Referenced by canThrow(), clang::CodeGen::CodeGenFunction::EmitStartEHSpec(), IsEquivalentExceptionSpec(), and printExceptionSpecification().

◆ getExtParameterInfo()

◆ getExtParameterInfos()

ArrayRef< ExtParameterInfo > clang::FunctionProtoType::getExtParameterInfos ( ) const
inline

◆ getExtParameterInfosOrNull()

const ExtParameterInfo * clang::FunctionProtoType::getExtParameterInfosOrNull ( ) const
inline

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.

This is equivalent to getExtProtoInfo().ExtParameterInfos.

Definition at line 5764 of file TypeBase.h.

References hasExtParameterInfos().

Referenced by getExtProtoInfo(), and clang::Sema::SubstituteExplicitTemplateArguments().

◆ getExtProtoInfo()

ExtProtoInfo clang::FunctionProtoType::getExtProtoInfo ( ) const
inline

Definition at line 5571 of file TypeBase.h.

References clang::FunctionProtoType::ExtProtoInfo::AArch64SMEAttributes, clang::FunctionProtoType::ExtProtoInfo::CFIUncheckedCallee, clang::FunctionProtoType::ExtProtoInfo::EllipsisLoc, clang::FunctionProtoType::ExtProtoInfo::ExceptionSpec, clang::FunctionProtoType::ExtProtoInfo::ExtInfo, clang::FunctionProtoType::ExtProtoInfo::ExtParameterInfos, clang::FunctionProtoType::ExtProtoInfo::ExtraAttributeInfo, clang::FunctionProtoType::ExtProtoInfo::FunctionEffects, getAArch64SMEAttributes(), getEllipsisLoc(), getExceptionSpecInfo(), clang::FunctionType::getExtInfo(), getExtParameterInfosOrNull(), getExtraAttributeInfo(), getFunctionEffects(), getMethodQuals(), getRefQualifier(), hasCFIUncheckedCallee(), clang::FunctionProtoType::ExtProtoInfo::HasTrailingReturn, hasTrailingReturn(), isVariadic(), clang::FunctionProtoType::ExtProtoInfo::RefQualifier, clang::FunctionProtoType::ExtProtoInfo::TypeQuals, and clang::FunctionProtoType::ExtProtoInfo::Variadic.

Referenced by clang::Sema::ActOnBlockStmtExpr(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::adjustCCAndNoReturn(), buildTypeForLambdaCallOperator(), clang::Sema::checkCall(), clang::Sema::CheckConstructorDeclarator(), clang::Sema::CheckDestructorDeclarator(), clang::Sema::CheckFunctionDeclaration(), clang::Sema::CheckFunctionTemplateSpecialization(), clang::desugarForDiagnostic(), clang::Sema::findInheritingConstructor(), clang::ASTReader::FinishedDeserializing(), GetFullTypeForDeclarator(), clang::Sema::getLambdaConversionFunctionResultType(), clang::TemplateDeclInstantiator::InitFunctionInstantiation(), LookupDirect(), clang::Sema::MergeFunctionDecl(), clang::ASTContext::mergeFunctionTypes(), Profile(), clang::Sema::SubstExceptionSpec(), and clang::Sema::SubstituteExplicitTemplateArguments().

◆ getExtraAttributeInfo()

FunctionTypeExtraAttributeInfo clang::FunctionProtoType::getExtraAttributeInfo ( ) const
inline

Return the extra attribute information.

Definition at line 5771 of file TypeBase.h.

Referenced by clang::CodeGen::CodeGenFunction::EmitKCFIOperandBundle(), and getExtProtoInfo().

◆ getFunctionEffectConditions()

ArrayRef< EffectConditionExpr > clang::FunctionProtoType::getFunctionEffectConditions ( ) const
inline

Definition at line 5835 of file TypeBase.h.

◆ getFunctionEffects()

FunctionEffectsRef clang::FunctionProtoType::getFunctionEffects ( ) const
inline

Definition at line 5846 of file TypeBase.h.

Referenced by getExtProtoInfo().

◆ getFunctionEffectsWithoutConditions()

ArrayRef< FunctionEffect > clang::FunctionProtoType::getFunctionEffectsWithoutConditions ( ) const
inline

Definition at line 5815 of file TypeBase.h.

◆ getMethodQuals()

◆ getNoexceptExpr()

Expr * clang::FunctionProtoType::getNoexceptExpr ( ) const
inline

◆ getNumExceptions()

unsigned clang::FunctionProtoType::getNumExceptions ( ) const
inline

◆ getNumFunctionEffectConditions()

unsigned clang::FunctionProtoType::getNumFunctionEffectConditions ( ) const
inline

Definition at line 5825 of file TypeBase.h.

◆ getNumFunctionEffects()

unsigned clang::FunctionProtoType::getNumFunctionEffects ( ) const
inline

Definition at line 5807 of file TypeBase.h.

◆ getNumParams()

unsigned clang::FunctionProtoType::getNumParams ( ) const
inline

◆ getParameterABI()

ParameterABI clang::FunctionProtoType::getParameterABI ( unsigned I) const
inline

Definition at line 5793 of file TypeBase.h.

References getNumParams(), hasExtParameterInfos(), and clang::Ordinary.

◆ getParamType()

◆ getParamTypes()

◆ getRefQualifier()

◆ hasCFIUncheckedCallee()

bool clang::FunctionProtoType::hasCFIUncheckedCallee ( ) const
inline

Definition at line 5704 of file TypeBase.h.

References clang::Type::FunctionTypeBits.

Referenced by getExtProtoInfo().

◆ hasDependentExceptionSpec()

bool FunctionProtoType::hasDependentExceptionSpec ( ) const

Return whether this function has a dependent exception spec.

Definition at line 3860 of file Type.cpp.

References exceptions(), clang::Type::getAs(), getNoexceptExpr(), and clang::Type::isDependentType().

Referenced by clang::Sema::CheckExceptionSpecCompatibility().

◆ hasDynamicExceptionSpec()

bool clang::FunctionProtoType::hasDynamicExceptionSpec ( ) const
inline

Return whether this function has a dynamic (throw) exception spec.

Definition at line 5598 of file TypeBase.h.

References getExceptionSpecType(), and clang::isDynamicExceptionSpec().

Referenced by printExceptionSpecification().

◆ hasExceptionSpec()

bool clang::FunctionProtoType::hasExceptionSpec ( ) const
inline

◆ hasExtParameterInfos()

◆ hasInstantiationDependentExceptionSpec()

bool FunctionProtoType::hasInstantiationDependentExceptionSpec ( ) const

Return whether this function has an instantiation-dependent exception spec.

Definition at line 3872 of file Type.cpp.

References exceptions(), getNoexceptExpr(), and clang::Type::isInstantiationDependentType().

◆ hasNoexceptExceptionSpec()

bool clang::FunctionProtoType::hasNoexceptExceptionSpec ( ) const
inline

Return whether this function has a noexcept exception spec.

Definition at line 5603 of file TypeBase.h.

References getExceptionSpecType(), and clang::isNoexceptExceptionSpec().

◆ hasTrailingReturn()

bool clang::FunctionProtoType::hasTrailingReturn ( ) const
inline

◆ isNothrow()

bool clang::FunctionProtoType::isNothrow ( bool ResultIfDependent = false) const
inline

Determine whether this function type has a non-throwing exception specification.

If this depends on template arguments, returns ResultIfDependent.

Definition at line 5681 of file TypeBase.h.

References canThrow(), clang::CT_Can, and clang::CT_Cannot.

Referenced by AddAttributesFromFunctionProtoType(), addAttributesFromFunctionProtoType(), EvaluateUnaryTypeTrait(), and HasNoThrowOperator().

◆ isParamConsumed()

bool clang::FunctionProtoType::isParamConsumed ( unsigned I) const
inline

Definition at line 5800 of file TypeBase.h.

References getNumParams(), and hasExtParameterInfos().

Referenced by clang::Sema::GatherArgumentsForCall().

◆ isSugared()

bool clang::FunctionProtoType::isSugared ( ) const
inline

Definition at line 5862 of file TypeBase.h.

◆ isTemplateVariadic()

bool FunctionProtoType::isTemplateVariadic ( ) const

Determines whether this function prototype contains a parameter pack at the end.

A function template whose last parameter is a parameter pack can be called with an arbitrary number of arguments, much like a variadic function.

Definition at line 3914 of file Type.cpp.

References getNumParams(), getParamType(), and clang::isa().

◆ isVariadic()

◆ param_type_begin()

◆ param_type_end()

param_type_iterator clang::FunctionProtoType::param_type_end ( ) const
inline

◆ param_types()

ArrayRef< QualType > clang::FunctionProtoType::param_types ( ) const
inline

◆ printExceptionSpecification()

void FunctionProtoType::printExceptionSpecification ( raw_ostream & OS,
const PrintingPolicy & Policy ) const

◆ Profile() [1/2]

void FunctionProtoType::Profile ( llvm::FoldingSetNodeID & ID,
const ASTContext & Ctx )

◆ Profile() [2/2]

void clang::FunctionProtoType::Profile ( llvm::FoldingSetNodeID & ID,
QualType Result,
param_type_iterator ArgTys,
unsigned NumArgs,
const ExtProtoInfo & EPI,
const ASTContext & Context,
bool Canonical )
static

References ASTContext, and clang::Result.

◆ ASTContext

friend class ASTContext
friend

Definition at line 5283 of file TypeBase.h.

References ASTContext.

Referenced by ASTContext, Profile(), and Profile().


The documentation for this class was generated from the following files: