class FunctionDecl
Declaration
class FunctionDecl : public DeclaratorDecl,
public DeclContext,
public Redeclarable { /* full declaration omitted */ };
Description
Represents a function declaration or definition. Since a given function can be declared several times in a program, there may be several FunctionDecls that correspond to that function. Only one of those FunctionDecls will be found when traversing the list of declarations in the context of the FunctionDecl (e.g., the translation unit); this FunctionDecl contains all of the information known about the function. Other, previous declarations of the function are available via the getPreviousDecl() chain.
Declared at: clang/include/clang/AST/Decl.h:1872
Inherits from: DeclaratorDecl, DeclContext, Redeclarable
Member Variables
- private clang::ParmVarDecl** ParamInfo = nullptr
- A new[]'d array of pointers to VarDecls for the formal parameters of this function. This is null if a prototype or if there are no formals.
- private anonymous struct / union
- private unsigned int ODRHash
- private clang::SourceLocation EndRangeLoc
- We could compute the full range in getSourceRange(). However, when we're dealing with a function definition deserialized from a PCH/AST file, we can only compute the full range once the function body has been de-serialized, so it's far better to have the (sometimes-redundant) EndRangeLoc.
- private llvm::PointerUnion< NamedDecl*, MemberSpecializationInfo*, FunctionTemplateSpecializationInfo*, DependentFunctionTemplateSpecializationInfo*> TemplateOrSpecialization
- For non-templates this value will be NULL, unless this declaration was declared directly inside of a function template, in which case it will have a pointer to a FunctionDecl, stored in the NamedDecl. For function declarations that describe a function template, this will be a pointer to a FunctionTemplateDecl, stored in the NamedDecl. For member functions of class template specializations, this will be a MemberSpecializationInfo pointer containing information about the specialization. For function template specializations, this will be a FunctionTemplateSpecializationInfo, which contains information about the template being specialized and the template arguments involved in that specialization.
- private clang::DeclarationNameLoc DNLoc
- Provides source/type location info for the declaration name embedded in the DeclaratorDecl base class.
Inherited from DeclContext:
- protected
- protected FirstDecl = nullptr
- protected LastDecl = nullptr
Inherited from Decl:
- protected NextInContextAndBits
- protected Access
- protected FromASTFile
- protected IdentifierNamespace
- protected CacheValidAndLinkage
Method Overview
- public static clang::FunctionDecl * Create(clang::ASTContext & C, clang::DeclContext * DC, clang::SourceLocation StartLoc, const clang::DeclarationNameInfo & NameInfo, clang::QualType T, clang::TypeSourceInfo * TInfo, clang::StorageClass SC, bool UsesFPIntrin, bool isInlineSpecified, bool hasWrittenPrototype, clang::ConstexprSpecKind ConstexprKind, clang::Expr * TrailingRequiresClause)
- public static clang::FunctionDecl * Create(clang::ASTContext & C, clang::DeclContext * DC, clang::SourceLocation StartLoc, clang::SourceLocation NLoc, clang::DeclarationName N, clang::QualType T, clang::TypeSourceInfo * TInfo, clang::StorageClass SC, bool UsesFPIntrin = false, bool isInlineSpecified = false, bool hasWrittenPrototype = true, clang::ConstexprSpecKind ConstexprKind = ConstexprSpecKind::Unspecified, clang::Expr * TrailingRequiresClause = nullptr)
- public static clang::FunctionDecl * CreateDeserialized(clang::ASTContext & C, unsigned int ID)
- protected FunctionDecl(clang::Decl::Kind DK, clang::ASTContext & C, clang::DeclContext * DC, clang::SourceLocation StartLoc, const clang::DeclarationNameInfo & NameInfo, clang::QualType T, clang::TypeSourceInfo * TInfo, clang::StorageClass S, bool UsesFPIntrin, bool isInlineSpecified, clang::ConstexprSpecKind ConstexprKind, clang::Expr * TrailingRequiresClause = nullptr)
- public bool UsesFPIntrin() const
- public static clang::FunctionDecl * castFromDeclContext(const clang::DeclContext * DC)
- public static clang::DeclContext * castToDeclContext(const clang::FunctionDecl * D)
- public static bool classof(const clang::Decl * D)
- public static bool classofKind(clang::Decl::Kind K)
- public bool doesDeclarationForceExternallyVisibleDefinition() const
- public bool doesThisDeclarationHaveABody() const
- public void getAssociatedConstraints(SmallVectorImpl<const clang::Expr *> & AC) const
- public clang::Stmt * getBody() const
- public clang::Stmt * getBody(const clang::FunctionDecl *& Definition) const
- public unsigned int getBuiltinID(bool ConsiderWrapperFunctions = false) const
- public clang::QualType getCallResultType() const
- public clang::FunctionDecl * getCanonicalDecl()
- public const clang::FunctionDecl * getCanonicalDecl() const
- public clang::ConstexprSpecKind getConstexprKind() const
- public clang::QualType getDeclaredReturnType() const
- public clang::FunctionDecl::DefaultedFunctionInfo * getDefaultedFunctionInfo() const
- public clang::FunctionDecl * getDefinition()
- public const clang::FunctionDecl * getDefinition() const
- public clang::DependentFunctionTemplateSpecializationInfo * getDependentSpecializationInfo() const
- public clang::FunctionTemplateDecl * getDescribedFunctionTemplate() const
- public clang::SourceLocation getEllipsisLoc() const
- public clang::SourceRange getExceptionSpecSourceRange() const
- public clang::ExceptionSpecificationType getExceptionSpecType() const
- public clang::FunctionTypeLoc getFunctionTypeLoc() const
- public clang::FunctionDecl * getInstantiatedFromDecl() const
- public clang::FunctionDecl * getInstantiatedFromMemberFunction() const
- public clang::LanguageLinkage getLanguageLinkage() const
- public const clang::IdentifierInfo * getLiteralIdentifier() const
- public clang::MemberSpecializationInfo * getMemberSpecializationInfo() const
- public unsigned int getMemoryFunctionKind() const
- public unsigned int getMinRequiredArguments() const
- protected clang::FunctionDecl * getMostRecentDeclImpl()
- public clang::MultiVersionKind getMultiVersionKind() const
- public void getNameForDiagnostic(llvm::raw_ostream & OS, const clang::PrintingPolicy & Policy, bool Qualified) const
- public clang::DeclarationNameInfo getNameInfo() const
- protected clang::FunctionDecl * getNextRedeclarationImpl()
- public unsigned int getNumParams() const
- public unsigned int getODRHash()
- public unsigned int getODRHash() const
- public clang::OverloadedOperatorKind getOverloadedOperator() const
- public const clang::ParmVarDecl * getParamDecl(unsigned int i) const
- public clang::ParmVarDecl * getParamDecl(unsigned int i)
- public clang::SourceRange getParametersSourceRange() const
- public clang::SourceLocation getPointOfInstantiation() const
- protected clang::FunctionDecl * getPreviousDeclImpl()
- public clang::FunctionTemplateDecl * getPrimaryTemplate() const
- public clang::QualType getReturnType() const
- public clang::SourceRange getReturnTypeSourceRange() const
- public clang::SourceRange getSourceRange() const
- public clang::StorageClass getStorageClass() const
- public clang::FunctionDecl * getTemplateInstantiationPattern(bool ForDefinition = true) const
- public const clang::TemplateArgumentList * getTemplateSpecializationArgs() const
- public const clang::ASTTemplateArgumentListInfo * getTemplateSpecializationArgsAsWritten() const
- public clang::FunctionTemplateSpecializationInfo * getTemplateSpecializationInfo() const
- public clang::TemplateSpecializationKind getTemplateSpecializationKind() const
- public clang::TemplateSpecializationKind getTemplateSpecializationKindForInstantiation() const
- public clang::FunctionDecl::TemplatedKind getTemplatedKind() const
- public bool hasBody(const clang::FunctionDecl *& Definition) const
- public bool hasBody() const
- public bool hasImplicitReturnZero() const
- public bool hasInheritedPrototype() const
- private bool hasODRHash() const
- public bool hasOneParamOrDefaultArgs() const
- public bool hasPrototype() const
- public bool hasSkippedBody() const
- public bool hasTrivialBody() const
- public bool hasWrittenPrototype() const
- public bool instantiationIsPending() const
- public bool isCPUDispatchMultiVersion() const
- public bool isCPUSpecificMultiVersion() const
- public bool isConsteval() const
- public bool isConstexpr() const
- public bool isConstexprSpecified() const
- public bool isDefaulted() const
- public bool isDefined() const
- public bool isDefined(const clang::FunctionDecl *& Definition, bool CheckForPendingFriendDefinition = false) const
- public bool isDeleted() const
- public bool isDeletedAsWritten() const
- private bool isDeletedBit() const
- public bool isDestroyingOperatorDelete() const
- public bool isExplicitlyDefaulted() const
- public bool isExternC() const
- public bool isFunctionTemplateSpecialization() const
- public bool isGlobal() const
- public bool isImplicitlyInstantiable() const
- public bool isInExternCContext() const
- public bool isInExternCXXContext() const
- public bool isIneligibleOrNotSelected() const
- public bool isInlineBuiltinDeclaration() const
- public bool isInlineDefinitionExternallyVisible() const
- public bool isInlineSpecified() const
- public bool isInlined() const
- public bool isLateTemplateParsed() const
- public bool isMSExternInline() const
- public bool isMSVCRTEntryPoint() const
- public bool isMain() const
- public bool isMultiVersion() const
- public bool isNoReturn() const
- public bool isOutOfLine() const
- public bool isOverloadedOperator() const
- public bool isPure() const
- public bool isReplaceableGlobalAllocationFunction(Optional<unsigned int> * AlignmentParam = nullptr, bool * IsNothrow = nullptr) const
- public bool isReservedGlobalPlacementOperator() const
- public bool isStatic() const
- public bool isTargetClonesMultiVersion() const
- public bool isTargetMultiVersion() const
- public bool isTemplateInstantiation() const
- public bool isThisDeclarationADefinition() const
- public bool isThisDeclarationInstantiatedFromAFriendDefinition() const
- public bool isTrivial() const
- public bool isTrivialForCall() const
- public bool isUserProvided() const
- public bool isVariadic() const
- public bool isVirtualAsWritten() const
- public clang::FunctionDecl::param_iterator param_begin()
- public clang::FunctionDecl::param_const_iterator param_begin() const
- public bool param_empty() const
- public clang::FunctionDecl::param_iterator param_end()
- public clang::FunctionDecl::param_const_iterator param_end() const
- public size_t param_size() const
- public ArrayRef<clang::ParmVarDecl *> parameters() const
- public MutableArrayRef<clang::ParmVarDecl *> parameters()
- public void setBody(clang::Stmt * B)
- public void setConstexprKind(clang::ConstexprSpecKind CSK)
- public void setDefaulted(bool D = true)
- public void setDefaultedFunctionInfo(clang::FunctionDecl::DefaultedFunctionInfo * Info)
- public void setDeletedAsWritten(bool D = true)
- public void setDependentTemplateSpecialization(clang::ASTContext & Context, const clang::UnresolvedSetImpl & Templates, const clang::TemplateArgumentListInfo & TemplateArgs)
- public void setDescribedFunctionTemplate(clang::FunctionTemplateDecl * Template)
- public void setExplicitlyDefaulted(bool ED = true)
- private void setFunctionTemplateSpecialization(clang::ASTContext & C, clang::FunctionTemplateDecl * Template, const clang::TemplateArgumentList * TemplateArgs, void * InsertPos, clang::TemplateSpecializationKind TSK, const clang::TemplateArgumentListInfo * TemplateArgsAsWritten, clang::SourceLocation PointOfInstantiation)
- public void setFunctionTemplateSpecialization(clang::FunctionTemplateDecl * Template, const clang::TemplateArgumentList * TemplateArgs, void * InsertPos, clang::TemplateSpecializationKind TSK = TSK_ImplicitInstantiation, const clang::TemplateArgumentListInfo * TemplateArgsAsWritten = nullptr, clang::SourceLocation PointOfInstantiation = clang::SourceLocation())
- public void setHasImplicitReturnZero(bool IRZ)
- public void setHasInheritedPrototype(bool P = true)
- private void setHasODRHash(bool B = true)
- public void setHasSkippedBody(bool Skipped = true)
- public void setHasWrittenPrototype(bool P = true)
- public void setImplicitlyInline(bool I = true)
- public void setIneligibleOrNotSelected(bool II)
- public void setInlineSpecified(bool I)
- public void setInstantiatedFromDecl(clang::FunctionDecl * FD)
- public void setInstantiationIsPending(bool IC)
- private void setInstantiationOfMemberFunction(clang::ASTContext & C, clang::FunctionDecl * FD, clang::TemplateSpecializationKind TSK)
- public void setInstantiationOfMemberFunction(clang::FunctionDecl * FD, clang::TemplateSpecializationKind TSK)
- public void setIsMultiVersion(bool V = true)
- public void setLateTemplateParsed(bool ILT = true)
- public void setLazyBody(uint64_t Offset)
- private void setParams(clang::ASTContext & C, ArrayRef<clang::ParmVarDecl *> NewParamInfo)
- public void setParams(ArrayRef<clang::ParmVarDecl *> NewParamInfo)
- public void setPreviousDeclaration(clang::FunctionDecl * PrevDecl)
- public void setPure(bool P = true)
- public void setRangeEnd(clang::SourceLocation E)
- public void setStorageClass(clang::StorageClass SClass)
- public void setTemplateSpecializationKind(clang::TemplateSpecializationKind TSK, clang::SourceLocation PointOfInstantiation = clang::SourceLocation())
- public void setTrivial(bool IT)
- public void setTrivialForCall(bool IT)
- public void setUsesFPIntrin(bool I)
- public void setUsesSEHTry(bool UST)
- public void setVirtualAsWritten(bool V)
- public void setWillHaveBody(bool V = true)
- public bool usesSEHTry() const
- public bool willHaveBody() const
Inherited from DeclContext:
- protected BuildDeclChain
- public Encloses
- public Equals
- public InEnclosingNamespaceSetOf
- public addDecl
- public addDeclInternal
- public addHiddenDecl
- public buildLookup
- public classof
- public classof
- public collectAllContexts
- public containsDecl
- public containsDeclAndLoad
- public ddiags
- public decls
- public decls_begin
- public decls_empty
- public decls_end
- public dumpDeclContext
- public dumpLookups
- public dumpLookups
- public getDeclKind
- public getDeclKindName
- public getEnclosingNamespaceContext
- public getEnclosingNamespaceContext
- public getExternCContext
- public getInnermostBlockDecl
- public getLexicalParent
- public getLexicalParent
- public getLookupParent
- public getLookupParent
- public getLookupPtr
- public getNonClosureAncestor
- public getNonClosureAncestor
- public getNonTransparentContext
- public getNonTransparentContext
- public getOuterLexicalRecordContext
- public getOuterLexicalRecordContext
- public getParent
- public getParent
- public getParentASTContext
- public getPrimaryContext
- public getPrimaryContext
- public getRedeclContext
- public getRedeclContext
- public hasExternalLexicalStorage
- public hasExternalVisibleStorage
- public isClosure
- public isDeclInLexicalTraversal
- public isDependentContext
- public isExternCContext
- public isExternCXXContext
- public isFileContext
- public isFunctionOrMethod
- public isInlineNamespace
- public isLookupContext
- public isNamespace
- public isObjCContainer
- public isRecord
- public isStdNamespace
- public isTranslationUnit
- public isTransparentContext
- public localUncachedLookup
- public lookup
- public lookups
- public lookups_begin
- public lookups_end
- public makeDeclVisibleInContext
- public noload_decls
- public noload_decls_begin
- public noload_decls_end
- public noload_lookup
- public noload_lookups
- public noload_lookups_begin
- public noload_lookups_end
- public removeDecl
- public setHasExternalLexicalStorage
- public setHasExternalVisibleStorage
- public setMustBuildLookupTable
- public setUseQualifiedLookup
- public shouldUseQualifiedLookup
- public using_directives
Inherited from DeclaratorDecl:
- public classof
- public classofKind
- public getBeginLoc
- public getInnerLocStart
- public getNumTemplateParameterLists
- public getOuterLocStart
- public getQualifier
- public getQualifierLoc
- public getSourceRange
- public getTemplateParameterList
- public getTrailingRequiresClause
- public getTrailingRequiresClause
- public getTypeSourceInfo
- public getTypeSpecEndLoc
- public getTypeSpecStartLoc
- public setInnerLocStart
- public setQualifierInfo
- public setTemplateParameterListsInfo
- public setTrailingRequiresClause
- public setTypeSourceInfo
Inherited from ValueDecl:
Inherited from NamedDecl:
- public classof
- public classofKind
- public declarationReplaces
- public getDeclName
- public getExplicitVisibility
- public getFormalLinkage
- public getIdentifier
- public getLinkageAndVisibility
- public getLinkageInternal
- public getMostRecentDecl
- public getMostRecentDecl
- public getName
- public getNameAsString
- public getNameForDiagnostic
- public getObjCFStringFormattingFamily
- public getQualifiedNameAsString
- public getUnderlyingDecl
- public getUnderlyingDecl
- public getVisibility
- public hasExternalFormalLinkage
- public hasLinkage
- public hasLinkageBeenComputed
- public isCXXClassMember
- public isCXXInstanceMember
- public isExternallyDeclarable
- public isExternallyVisible
- public isLinkageValid
- public isReserved
- public printName
- public printNestedNameSpecifier
- public printNestedNameSpecifier
- public printQualifiedName
- public printQualifiedName
- public setDeclName
Inherited from Decl:
- public EnableStatistics
- public PrintStats
- public add
- public addAttr
- public attr_begin
- public attr_end
- public attrs
- public canBeWeakImported
- public castFromDeclContext
- public castToDeclContext
- public classofKind
- public dropAttr
- public dropAttrs
- public dump
- public dump
- public dumpColor
- public getASTContext
- protected getASTMutationListener
- public getAccess
- public getAccessUnsafe
- public getAsFunction
- public getAsFunction
- public getAttr
- public getAttrs
- public getAttrs
- public getAvailability
- public getBeginLoc
- public getBody
- public getBodyRBrace
- protected getCachedLinkage
- public getCanonicalDecl
- public getCanonicalDecl
- public getDeclContext
- public getDeclContext
- public getDeclKindName
- public getDefiningAttr
- public getDescribedTemplate
- public getDescribedTemplateParams
- public getEndLoc
- public getExternalSourceSymbolAttr
- public getFriendObjectKind
- public getFunctionType
- public getGlobalID
- public getID
- public getIdentifierNamespace
- public getIdentifierNamespaceForKind
- public getImportedOwningModule
- public getKind
- public getLangOpts
- public getLexicalDeclContext
- public getLexicalDeclContext
- public getLocalOwningModule
- public getLocation
- public getMaxAlignment
- public getModuleOwnershipKind
- public getMostRecentDecl
- public getMostRecentDecl
- protected getMostRecentDeclImpl
- public getNextDeclInContext
- public getNextDeclInContext
- protected getNextRedeclarationImpl
- public getNonClosureContext
- public getNonClosureContext
- public getOwningModule
- public getOwningModuleForLinkage
- public getOwningModuleID
- public getParentFunctionOrMethod
- public getParentFunctionOrMethod
- public getPreviousDecl
- public getPreviousDecl
- protected getPreviousDeclImpl
- public getSourceRange
- public getTemplateDepth
- public getTranslationUnitDecl
- public getTranslationUnitDecl
- public getVersionIntroduced
- public hasAttr
- public hasAttrs
- public hasBody
- protected hasCachedLinkage
- public hasDefiningAttr
- protected hasLocalOwningModuleStorage
- public hasOwningModule
- public hasTagIdentifierNamespace
- public isCanonicalDecl
- public isDefinedOutsideFunctionOrMethod
- public isDeprecated
- public isDiscardedInGlobalModuleFragment
- public isFirstDecl
- public isFromASTFile
- public isFunctionOrFunctionTemplate
- public isImplicit
- public isInAnonymousNamespace
- public isInExportDeclContext
- public isInIdentifierNamespace
- public isInLocalScopeForInstantiation
- public isInStdNamespace
- public isInvalidDecl
- public isInvisibleOutsideTheOwningModule
- public isLocalExternDecl
- public isModulePrivate
- public isOutOfLine
- public isParameterPack
- public isReachable
- public isReferenced
- public isTagIdentifierNamespace
- public isTemplateDecl
- public isTemplateParameter
- public isTemplateParameterPack
- public isTemplated
- public isThisDeclarationReferenced
- public isTopLevelDeclInObjCContainer
- public isUnavailable
- public isUnconditionallyVisible
- public isUsed
- public isWeakImported
- public markUsed
- public print
- public print
- public printGroup
- public redecls
- public redecls_begin
- public redecls_end
- public setAccess
- public setAttrs
- protected setCachedLinkage
- public setDeclContext
- public setFromASTFile
- public setImplicit
- public setInvalidDecl
- public setIsUsed
- public setLexicalDeclContext
- public setLocalExternDecl
- public setLocalOwningModule
- public setLocation
- public setModuleOwnershipKind
- protected setModulePrivate
- public setNonMemberOperator
- public setObjectOfFriendDecl
- public setOwningModuleID
- public setReferenced
- public setTopLevelDeclInObjCContainer
- public setVisibleDespiteOwningModule
- public specific_attr_begin
- public specific_attr_end
- public specific_attrs
- protected updateOutOfDate
Methods
¶static clang::FunctionDecl* Create(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::SourceLocation StartLoc,
const clang::DeclarationNameInfo& NameInfo,
clang::QualType T,
clang::TypeSourceInfo* TInfo,
clang::StorageClass SC,
bool UsesFPIntrin,
bool isInlineSpecified,
bool hasWrittenPrototype,
clang::ConstexprSpecKind ConstexprKind,
clang::Expr* TrailingRequiresClause)
static clang::FunctionDecl* Create(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::SourceLocation StartLoc,
const clang::DeclarationNameInfo& NameInfo,
clang::QualType T,
clang::TypeSourceInfo* TInfo,
clang::StorageClass SC,
bool UsesFPIntrin,
bool isInlineSpecified,
bool hasWrittenPrototype,
clang::ConstexprSpecKind ConstexprKind,
clang::Expr* TrailingRequiresClause)
Declared at: clang/include/clang/AST/Decl.h:2062
Parameters
- clang::ASTContext& C
- clang::DeclContext* DC
- clang::SourceLocation StartLoc
- const clang::DeclarationNameInfo& NameInfo
- clang::QualType T
- clang::TypeSourceInfo* TInfo
- clang::StorageClass SC
- bool UsesFPIntrin
- bool isInlineSpecified
- bool hasWrittenPrototype
- clang::ConstexprSpecKind ConstexprKind
- clang::Expr* TrailingRequiresClause
¶static clang::FunctionDecl* Create(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::SourceLocation StartLoc,
clang::SourceLocation NLoc,
clang::DeclarationName N,
clang::QualType T,
clang::TypeSourceInfo* TInfo,
clang::StorageClass SC,
bool UsesFPIntrin = false,
bool isInlineSpecified = false,
bool hasWrittenPrototype = true,
clang::ConstexprSpecKind ConstexprKind =
ConstexprSpecKind::Unspecified,
clang::Expr* TrailingRequiresClause = nullptr)
static clang::FunctionDecl* Create(
clang::ASTContext& C,
clang::DeclContext* DC,
clang::SourceLocation StartLoc,
clang::SourceLocation NLoc,
clang::DeclarationName N,
clang::QualType T,
clang::TypeSourceInfo* TInfo,
clang::StorageClass SC,
bool UsesFPIntrin = false,
bool isInlineSpecified = false,
bool hasWrittenPrototype = true,
clang::ConstexprSpecKind ConstexprKind =
ConstexprSpecKind::Unspecified,
clang::Expr* TrailingRequiresClause = nullptr)
Declared at: clang/include/clang/AST/Decl.h:2048
Parameters
- clang::ASTContext& C
- clang::DeclContext* DC
- clang::SourceLocation StartLoc
- clang::SourceLocation NLoc
- clang::DeclarationName N
- clang::QualType T
- clang::TypeSourceInfo* TInfo
- clang::StorageClass SC
- bool UsesFPIntrin = false
- bool isInlineSpecified = false
- bool hasWrittenPrototype = true
- clang::ConstexprSpecKind ConstexprKind = ConstexprSpecKind::Unspecified
- clang::Expr* TrailingRequiresClause = nullptr
¶static clang::FunctionDecl* CreateDeserialized(
clang::ASTContext& C,
unsigned int ID)
static clang::FunctionDecl* CreateDeserialized(
clang::ASTContext& C,
unsigned int ID)
Declared at: clang/include/clang/AST/Decl.h:2068
Parameters
- clang::ASTContext& C
- unsigned int ID
¶FunctionDecl(
clang::Decl::Kind DK,
clang::ASTContext& C,
clang::DeclContext* DC,
clang::SourceLocation StartLoc,
const clang::DeclarationNameInfo& NameInfo,
clang::QualType T,
clang::TypeSourceInfo* TInfo,
clang::StorageClass S,
bool UsesFPIntrin,
bool isInlineSpecified,
clang::ConstexprSpecKind ConstexprKind,
clang::Expr* TrailingRequiresClause = nullptr)
FunctionDecl(
clang::Decl::Kind DK,
clang::ASTContext& C,
clang::DeclContext* DC,
clang::SourceLocation StartLoc,
const clang::DeclarationNameInfo& NameInfo,
clang::QualType T,
clang::TypeSourceInfo* TInfo,
clang::StorageClass S,
bool UsesFPIntrin,
bool isInlineSpecified,
clang::ConstexprSpecKind ConstexprKind,
clang::Expr* TrailingRequiresClause = nullptr)
Declared at: clang/include/clang/AST/Decl.h:2013
Parameters
- clang::Decl::Kind DK
- clang::ASTContext& C
- clang::DeclContext* DC
- clang::SourceLocation StartLoc
- const clang::DeclarationNameInfo& NameInfo
- clang::QualType T
- clang::TypeSourceInfo* TInfo
- clang::StorageClass S
- bool UsesFPIntrin
- bool isInlineSpecified
- clang::ConstexprSpecKind ConstexprKind
- clang::Expr* TrailingRequiresClause = nullptr
¶bool UsesFPIntrin() const
bool UsesFPIntrin() const
Description
Determine whether the function was declared in source context that requires constrained FP intrinsics
Declared at: clang/include/clang/AST/Decl.h:2632
¶static clang::FunctionDecl* castFromDeclContext(
const clang::DeclContext* DC)
static clang::FunctionDecl* castFromDeclContext(
const clang::DeclContext* DC)
Declared at: clang/include/clang/AST/Decl.h:2867
Parameters
- const clang::DeclContext* DC
¶static clang::DeclContext* castToDeclContext(
const clang::FunctionDecl* D)
static clang::DeclContext* castToDeclContext(
const clang::FunctionDecl* D)
Declared at: clang/include/clang/AST/Decl.h:2864
Parameters
- const clang::FunctionDecl* D
¶static bool classof(const clang::Decl* D)
static bool classof(const clang::Decl* D)
Declared at: clang/include/clang/AST/Decl.h:2860
Parameters
- const clang::Decl* D
¶static bool classofKind(clang::Decl::Kind K)
static bool classofKind(clang::Decl::Kind K)
Declared at: clang/include/clang/AST/Decl.h:2861
Parameters
- clang::Decl::Kind K
¶bool doesDeclarationForceExternallyVisibleDefinition()
const
bool doesDeclarationForceExternallyVisibleDefinition()
const
Declared at: clang/include/clang/AST/Decl.h:2650
¶bool doesThisDeclarationHaveABody() const
bool doesThisDeclarationHaveABody() const
Description
Returns whether this specific declaration of the function has a body.
Declared at: clang/include/clang/AST/Decl.h:2183
¶void getAssociatedConstraints(
SmallVectorImpl<const clang::Expr*>& AC) const
void getAssociatedConstraints(
SmallVectorImpl<const clang::Expr*>& AC) const
Description
Get the associated-constraints of this function declaration. Currently, this will either be a vector of size 1 containing the trailing-requires-clause or an empty vector.
Use this instead of getTrailingRequiresClause for concepts APIs that accept an ArrayRef of constraint expressions.
Declared at: clang/include/clang/AST/Decl.h:2499
Parameters
- SmallVectorImpl<const clang::Expr*>& AC
¶clang::Stmt* getBody() const
clang::Stmt* getBody() const
Description
getBody - If this Decl represents a declaration for a body of code, such as a function or method definition, this method returns the top-level Stmt* of that body. Otherwise this method returns null.
Declared at: clang/include/clang/AST/Decl.h:2157
¶clang::Stmt* getBody(
const clang::FunctionDecl*& Definition) const
clang::Stmt* getBody(
const clang::FunctionDecl*& Definition) const
Description
Retrieve the body (definition) of the function. The function body might be in any of the (re-)declarations of this function. The variant that accepts a FunctionDecl pointer will set that function declaration to the actual declaration containing the body (if there is one). NOTE: For checking if there is a body, use hasBody() instead, to avoid unnecessary AST de-serialization of the body.
Declared at: clang/include/clang/AST/Decl.h:2155
Parameters
- const clang::FunctionDecl*& Definition
¶unsigned int getBuiltinID(
bool ConsiderWrapperFunctions = false) const
unsigned int getBuiltinID(
bool ConsiderWrapperFunctions = false) const
Declared at: clang/include/clang/AST/Decl.h:2511
Parameters
- bool ConsiderWrapperFunctions = false
¶clang::QualType getCallResultType() const
clang::QualType getCallResultType() const
Description
Determine the type of an expression that calls this function.
Declared at: clang/include/clang/AST/Decl.h:2604
¶clang::FunctionDecl* getCanonicalDecl()
clang::FunctionDecl* getCanonicalDecl()
Description
Retrieves the "canonical" declaration of the given declaration.
Declared at: clang/include/clang/AST/Decl.h:2506
¶const clang::FunctionDecl* getCanonicalDecl()
const
const clang::FunctionDecl* getCanonicalDecl()
const
Declared at: clang/include/clang/AST/Decl.h:2507
¶clang::ConstexprSpecKind getConstexprKind() const
clang::ConstexprSpecKind getConstexprKind() const
Declared at: clang/include/clang/AST/Decl.h:2316
¶clang::QualType getDeclaredReturnType() const
clang::QualType getDeclaredReturnType() const
Description
Get the declared return type, which may differ from the actual return type if the return type is deduced.
Declared at: clang/include/clang/AST/Decl.h:2585
¶clang::FunctionDecl::DefaultedFunctionInfo*
getDefaultedFunctionInfo() const
clang::FunctionDecl::DefaultedFunctionInfo*
getDefaultedFunctionInfo() const
Declared at: clang/include/clang/AST/Decl.h:2195
¶clang::FunctionDecl* getDefinition()
clang::FunctionDecl* getDefinition()
Description
Get the definition for this declaration.
Declared at: clang/include/clang/AST/Decl.h:2139
¶const clang::FunctionDecl* getDefinition() const
const clang::FunctionDecl* getDefinition() const
Declared at: clang/include/clang/AST/Decl.h:2145
¶clang::
DependentFunctionTemplateSpecializationInfo*
getDependentSpecializationInfo() const
clang::
DependentFunctionTemplateSpecializationInfo*
getDependentSpecializationInfo() const
Declared at: clang/include/clang/AST/Decl.h:2817
¶clang::FunctionTemplateDecl*
getDescribedFunctionTemplate() const
clang::FunctionTemplateDecl*
getDescribedFunctionTemplate() const
Description
Retrieves the function template that is described by this function declaration. Every function template is represented as a FunctionTemplateDecl and a FunctionDecl (or something derived from FunctionDecl). The former contains template properties (such as the template parameter lists) while the latter contains the actual description of the template's contents. FunctionTemplateDecl::getTemplatedDecl() retrieves the FunctionDecl that describes the function template, getDescribedFunctionTemplate() retrieves the FunctionTemplateDecl from a FunctionDecl.
Declared at: clang/include/clang/AST/Decl.h:2721
¶clang::SourceLocation getEllipsisLoc() const
clang::SourceLocation getEllipsisLoc() const
Description
Returns the location of the ellipsis of a variadic function.
Declared at: clang/include/clang/AST/Decl.h:2080
¶clang::SourceRange getExceptionSpecSourceRange()
const
clang::SourceRange getExceptionSpecSourceRange()
const
Description
Attempt to compute an informative source range covering the function exception specification, if any.
Declared at: clang/include/clang/AST/Decl.h:2601
¶clang::ExceptionSpecificationType
getExceptionSpecType() const
clang::ExceptionSpecificationType
getExceptionSpecType() const
Description
Gets the ExceptionSpecificationType as declared.
Declared at: clang/include/clang/AST/Decl.h:2592
¶clang::FunctionTypeLoc getFunctionTypeLoc() const
clang::FunctionTypeLoc getFunctionTypeLoc() const
Description
Find the source location information for how the type of this function was written. May be absent (for example if the function was declared via a typedef) and may contain a different type from that of the function (for example if the function type was adjusted by an attribute).
Declared at: clang/include/clang/AST/Decl.h:2566
¶clang::FunctionDecl* getInstantiatedFromDecl()
const
clang::FunctionDecl* getInstantiatedFromDecl()
const
Declared at: clang/include/clang/AST/Decl.h:2707
¶clang::FunctionDecl*
getInstantiatedFromMemberFunction() const
clang::FunctionDecl*
getInstantiatedFromMemberFunction() const
Description
If this function is an instantiation of a member function of a class template specialization, retrieves the function from which it was instantiated. This routine will return non-NULL for (non-templated) member functions of class templates and for instantiations of function templates. For example, given: The declaration for X <int >::f is a (non-templated) FunctionDecl whose parent is the class template specialization X <int >. For this declaration, getInstantiatedFromFunction() will return the FunctionDecl X <T >::A. When a complete definition of X <int >::A is required, it will be instantiated from the declaration returned by getInstantiatedFromMemberFunction().
Declared at: clang/include/clang/AST/Decl.h:2685
¶clang::LanguageLinkage getLanguageLinkage() const
clang::LanguageLinkage getLanguageLinkage() const
Description
Compute the language linkage.
Declared at: clang/include/clang/AST/Decl.h:2430
¶const clang::IdentifierInfo*
getLiteralIdentifier() const
const clang::IdentifierInfo*
getLiteralIdentifier() const
Declared at: clang/include/clang/AST/Decl.h:2662
¶clang::MemberSpecializationInfo*
getMemberSpecializationInfo() const
clang::MemberSpecializationInfo*
getMemberSpecializationInfo() const
Description
If this function is an instantiation of a member function of a class template specialization, retrieves the member specialization information.
Declared at: clang/include/clang/AST/Decl.h:2693
¶unsigned int getMemoryFunctionKind() const
unsigned int getMemoryFunctionKind() const
Description
Identify a memory copying or setting function. If the given function is a memory copy or setting function, returns the corresponding Builtin ID. If the function is not a memory function, returns 0.
Declared at: clang/include/clang/AST/Decl.h:2849
¶unsigned int getMinRequiredArguments() const
unsigned int getMinRequiredArguments() const
Description
Returns the minimum number of arguments needed to call this function. This may be fewer than the number of function parameters, if some of the parameters have default arguments (in C++).
Declared at: clang/include/clang/AST/Decl.h:2552
¶clang::FunctionDecl* getMostRecentDeclImpl()
clang::FunctionDecl* getMostRecentDeclImpl()
Description
Implementation of getMostRecentDecl(), to be overridden by any subclass that has a redeclaration chain.
Declared at: clang/include/clang/AST/Decl.h:2029
¶clang::MultiVersionKind getMultiVersionKind()
const
clang::MultiVersionKind getMultiVersionKind()
const
Description
Gets the kind of multiversioning attribute this declaration has. Note that this can return a value even if the function is not multiversion, such as the case of 'target'.
Declared at: clang/include/clang/AST/Decl.h:2475
¶void getNameForDiagnostic(
llvm::raw_ostream& OS,
const clang::PrintingPolicy& Policy,
bool Qualified) const
void getNameForDiagnostic(
llvm::raw_ostream& OS,
const clang::PrintingPolicy& Policy,
bool Qualified) const
Description
Appends a human-readable name for this declaration into the given stream. This is the method invoked by Sema when displaying a NamedDecl in a diagnostic. It does not necessarily produce the same result as printName(); for example, class template specializations are printed with their template arguments.
Declared at: clang/include/clang/AST/Decl.h:2074
Parameters
- llvm::raw_ostream& OS
- const clang::PrintingPolicy& Policy
- bool Qualified
¶clang::DeclarationNameInfo getNameInfo() const
clang::DeclarationNameInfo getNameInfo() const
Declared at: clang/include/clang/AST/Decl.h:2070
¶clang::FunctionDecl* getNextRedeclarationImpl()
clang::FunctionDecl* getNextRedeclarationImpl()
Description
Returns the next redeclaration or itself if this is the only decl. Decl subclasses that can be redeclared should override this method so that Decl::redecl_iterator can iterate over them.
Declared at: clang/include/clang/AST/Decl.h:2021
¶unsigned int getNumParams() const
unsigned int getNumParams() const
Description
Return the number of parameters this function must have based on its FunctionType. This is the length of the ParamInfo array after it has been created.
Declared at: clang/include/clang/AST/Decl.h:2535
¶unsigned int getODRHash()
unsigned int getODRHash()
Description
Returns ODRHash of the function. This value is calculated and stored on first call, then the stored value returned on the other calls.
Declared at: clang/include/clang/AST/Decl.h:2853
¶unsigned int getODRHash() const
unsigned int getODRHash() const
Description
Returns cached ODRHash of the function. This must have been previously computed and stored.
Declared at: clang/include/clang/AST/Decl.h:2857
¶clang::OverloadedOperatorKind
getOverloadedOperator() const
clang::OverloadedOperatorKind
getOverloadedOperator() const
Declared at: clang/include/clang/AST/Decl.h:2660
¶const clang::ParmVarDecl* getParamDecl(
unsigned int i) const
const clang::ParmVarDecl* getParamDecl(
unsigned int i) const
Declared at: clang/include/clang/AST/Decl.h:2537
Parameters
- unsigned int i
¶clang::ParmVarDecl* getParamDecl(unsigned int i)
clang::ParmVarDecl* getParamDecl(unsigned int i)
Declared at: clang/include/clang/AST/Decl.h:2541
Parameters
- unsigned int i
¶clang::SourceRange getParametersSourceRange()
const
clang::SourceRange getParametersSourceRange()
const
Description
Attempt to compute an informative source range covering the function parameters, including the ellipsis of a variadic function. The source range excludes the parentheses, and is invalid if there are no parameters and no ellipsis.
Declared at: clang/include/clang/AST/Decl.h:2581
¶clang::SourceLocation getPointOfInstantiation()
const
clang::SourceLocation getPointOfInstantiation()
const
Description
Retrieve the (first) point of instantiation of a function template specialization or a member of a class template specialization.
Declared at: clang/include/clang/AST/Decl.h:2839
Returns
the first point of instantiation, if this function was instantiated from a template; otherwise, returns an invalid source location.
¶clang::FunctionDecl* getPreviousDeclImpl()
clang::FunctionDecl* getPreviousDeclImpl()
Description
Implementation of getPreviousDecl(), to be overridden by any subclass that has a redeclaration chain.
Declared at: clang/include/clang/AST/Decl.h:2025
¶clang::FunctionTemplateDecl* getPrimaryTemplate()
const
clang::FunctionTemplateDecl* getPrimaryTemplate()
const
Description
Retrieve the primary template that this function template specialization either specializes or was instantiated from. If this function declaration is not a function template specialization, returns NULL.
Declared at: clang/include/clang/AST/Decl.h:2761
¶clang::QualType getReturnType() const
clang::QualType getReturnType() const
Declared at: clang/include/clang/AST/Decl.h:2568
¶clang::SourceRange getReturnTypeSourceRange()
const
clang::SourceRange getReturnTypeSourceRange()
const
Description
Attempt to compute an informative source range covering the function return type. This may omit qualifiers and other information with limited representation in the AST.
Declared at: clang/include/clang/AST/Decl.h:2575
¶clang::SourceRange getSourceRange() const
clang::SourceRange getSourceRange() const
Description
Source range that this declaration covers.
Declared at: clang/include/clang/AST/Decl.h:2087
¶clang::StorageClass getStorageClass() const
clang::StorageClass getStorageClass() const
Description
Returns the storage class as written in the source. For the computed linkage of symbol, see getLinkage.
Declared at: clang/include/clang/AST/Decl.h:2611
¶clang::FunctionDecl*
getTemplateInstantiationPattern(
bool ForDefinition = true) const
clang::FunctionDecl*
getTemplateInstantiationPattern(
bool ForDefinition = true) const
Description
Retrieve the function declaration from which this function could be instantiated, if it is an instantiation (rather than a non-template or a specialization, for example). If \p ForDefinition is \c false, explicit specializations will be treated as if they were implicit instantiations. This will then find the pattern corresponding to non-definition portions of the declaration, such as default arguments and the exception specification.
Declared at: clang/include/clang/AST/Decl.h:2754
Parameters
- bool ForDefinition = true
¶const clang::TemplateArgumentList*
getTemplateSpecializationArgs() const
const clang::TemplateArgumentList*
getTemplateSpecializationArgs() const
Description
Retrieve the template arguments used to produce this function template specialization from the primary template. If this function declaration is not a function template specialization, returns NULL.
Declared at: clang/include/clang/AST/Decl.h:2768
¶const clang::ASTTemplateArgumentListInfo*
getTemplateSpecializationArgsAsWritten() const
const clang::ASTTemplateArgumentListInfo*
getTemplateSpecializationArgsAsWritten() const
Description
Retrieve the template argument list as written in the sources, if any. If this function declaration is not a function template specialization or if it had no explicit template argument list, returns NULL. Note that it an explicit template argument list may be written empty, e.g., template < > void foo < >(char* s);
Declared at: clang/include/clang/AST/Decl.h:2778
¶clang::FunctionTemplateSpecializationInfo*
getTemplateSpecializationInfo() const
clang::FunctionTemplateSpecializationInfo*
getTemplateSpecializationInfo() const
Description
If this function is actually a function template specialization, retrieve information about this function template specialization. Otherwise, returns NULL.
Declared at: clang/include/clang/AST/Decl.h:2734
¶clang::TemplateSpecializationKind
getTemplateSpecializationKind() const
clang::TemplateSpecializationKind
getTemplateSpecializationKind() const
Description
Determine what kind of template instantiation this function represents.
Declared at: clang/include/clang/AST/Decl.h:2821
¶clang::TemplateSpecializationKind
getTemplateSpecializationKindForInstantiation()
const
clang::TemplateSpecializationKind
getTemplateSpecializationKindForInstantiation()
const
Description
Determine the kind of template specialization this function represents for the purpose of template instantiation.
Declared at: clang/include/clang/AST/Decl.h:2826
¶clang::FunctionDecl::TemplatedKind
getTemplatedKind() const
clang::FunctionDecl::TemplatedKind
getTemplatedKind() const
Description
What kind of templated function this is.
Declared at: clang/include/clang/AST/Decl.h:2688
¶bool hasBody(
const clang::FunctionDecl*& Definition) const
bool hasBody(
const clang::FunctionDecl*& Definition) const
Description
Returns true if the function has a body. The function body might be in any of the (re-)declarations of this function. The variant that accepts a FunctionDecl pointer will set that function declaration to the actual declaration containing the body (if there is one).
Declared at: clang/include/clang/AST/Decl.h:2108
Parameters
- const clang::FunctionDecl*& Definition
¶bool hasBody() const
bool hasBody() const
Description
Returns true if this \c Decl represents a declaration for a body of code, such as a function or method definition. Note that \c hasBody can also return true if any redeclaration of this\c Decl represents a declaration for a body of code.
Declared at: clang/include/clang/AST/Decl.h:2110
¶bool hasImplicitReturnZero() const
bool hasImplicitReturnZero() const
Description
Whether falling off this function implicitly returns null/zero. If a more specific implicit return value is required, front-ends should synthesize the appropriate return statements.
Declared at: clang/include/clang/AST/Decl.h:2268
¶bool hasInheritedPrototype() const
bool hasInheritedPrototype() const
Description
Whether this function inherited its prototype from a previous declaration.
Declared at: clang/include/clang/AST/Decl.h:2299
¶bool hasODRHash() const
bool hasODRHash() const
Description
Whether an ODRHash has been stored.
Declared at: clang/include/clang/AST/Decl.h:2007
¶bool hasOneParamOrDefaultArgs() const
bool hasOneParamOrDefaultArgs() const
Description
Determine whether this function has a single parameter, or multiple parameters where all but the first have default arguments. This notion is used in the definition of copy/move constructors and initializer list constructors. Note that, unlike getMinRequiredArguments, parameter packs are not treated specially here.
Declared at: clang/include/clang/AST/Decl.h:2560
¶bool hasPrototype() const
bool hasPrototype() const
Description
Whether this function has a prototype, either because one was explicitly written or because it was "inherited" by merging a declaration without a prototype with a declaration that has a prototype.
Declared at: clang/include/clang/AST/Decl.h:2283
¶bool hasSkippedBody() const
bool hasSkippedBody() const
Description
True if the function was a definition but its body was skipped.
Declared at: clang/include/clang/AST/Decl.h:2452
¶bool hasTrivialBody() const
bool hasTrivialBody() const
Description
Returns whether the function has a trivial body that does not require any specific codegen.
Declared at: clang/include/clang/AST/Decl.h:2117
¶bool hasWrittenPrototype() const
bool hasWrittenPrototype() const
Description
Whether this function has a written prototype.
Declared at: clang/include/clang/AST/Decl.h:2288
¶bool instantiationIsPending() const
bool instantiationIsPending() const
Description
Whether the instantiation of this function is pending. This bit is set when the decision to instantiate this function is made and unset if and when the function body is created. That leaves out cases where instantiation did not happen because the template definition was not seen in this TU. This bit remains set in those cases, under the assumption that the instantiation will happen in some other TU.
Declared at: clang/include/clang/AST/Decl.h:2332
¶bool isCPUDispatchMultiVersion() const
bool isCPUDispatchMultiVersion() const
Description
True if this function is a multiversioned dispatch function as a part of the cpu_specific/cpu_dispatch functionality.
Declared at: clang/include/clang/AST/Decl.h:2480
¶bool isCPUSpecificMultiVersion() const
bool isCPUSpecificMultiVersion() const
Description
True if this function is a multiversioned processor specific function as a part of the cpu_specific/cpu_dispatch functionality.
Declared at: clang/include/clang/AST/Decl.h:2483
¶bool isConsteval() const
bool isConsteval() const
Declared at: clang/include/clang/AST/Decl.h:2322
¶bool isConstexpr() const
bool isConstexpr() const
Description
Whether this is a (C++11) constexpr function or constexpr constructor.
Declared at: clang/include/clang/AST/Decl.h:2310
¶bool isConstexprSpecified() const
bool isConstexprSpecified() const
Declared at: clang/include/clang/AST/Decl.h:2319
¶bool isDefaulted() const
bool isDefaulted() const
Description
Whether this function is defaulted. Valid for e.g. special member functions, defaulted comparisions (not methods!).
Declared at: clang/include/clang/AST/Decl.h:2235
¶bool isDefined() const
bool isDefined() const
Declared at: clang/include/clang/AST/Decl.h:2133
¶bool isDefined(
const clang::FunctionDecl*& Definition,
bool CheckForPendingFriendDefinition =
false) const
bool isDefined(
const clang::FunctionDecl*& Definition,
bool CheckForPendingFriendDefinition =
false) const
Description
Returns true if the function has a definition that does not need to be instantiated. The variant that accepts a FunctionDecl pointer will set that function declaration to the declaration that is a definition (if there is one).
Declared at: clang/include/clang/AST/Decl.h:2130
Parameters
- const clang::FunctionDecl*& Definition
- bool CheckForPendingFriendDefinition = false
- If \c true, also check for friend declarations that were instantiataed from function definitions. Such a declaration behaves as if it is a definition for the purpose of redefinition checking, but isn't actually a "real" definition until its body is instantiated.
¶bool isDeleted() const
bool isDeleted() const
Description
Whether this function has been deleted. A function that is "deleted" (via the C++0x "= delete" syntax) acts like a normal function, except that it cannot actually be called or have its address taken. Deleted functions are typically used in C++ overload resolution to attract arguments whose type or lvalue/rvalue-ness would permit the use of a different overload that would behave incorrectly. For example, one might use deleted functions to ban implicit conversion from a floating-point number to an Integer type:
Declared at: clang/include/clang/AST/Decl.h:2365
¶bool isDeletedAsWritten() const
bool isDeletedAsWritten() const
Declared at: clang/include/clang/AST/Decl.h:2369
¶bool isDeletedBit() const
bool isDeletedBit() const
Declared at: clang/include/clang/AST/Decl.h:2004
¶bool isDestroyingOperatorDelete() const
bool isDestroyingOperatorDelete() const
Description
Determine whether this is a destroying operator delete.
Declared at: clang/include/clang/AST/Decl.h:2427
¶bool isExplicitlyDefaulted() const
bool isExplicitlyDefaulted() const
Description
Whether this function is explicitly defaulted.
Declared at: clang/include/clang/AST/Decl.h:2239
¶bool isExternC() const
bool isExternC() const
Description
Determines whether this function is a function with external, C linkage.
Declared at: clang/include/clang/AST/Decl.h:2434
¶bool isFunctionTemplateSpecialization() const
bool isFunctionTemplateSpecialization() const
Description
Determine whether this function is a function template specialization.
Declared at: clang/include/clang/AST/Decl.h:2727
¶bool isGlobal() const
bool isGlobal() const
Description
Determines whether this is a global function.
Declared at: clang/include/clang/AST/Decl.h:2445
¶bool isImplicitlyInstantiable() const
bool isImplicitlyInstantiable() const
Description
Determines whether this function is a function template specialization or a member of a class template specialization that can be implicitly instantiated.
Declared at: clang/include/clang/AST/Decl.h:2739
¶bool isInExternCContext() const
bool isInExternCContext() const
Description
Determines whether this function's context is, or is nested within, a C++ extern "C" linkage spec.
Declared at: clang/include/clang/AST/Decl.h:2438
¶bool isInExternCXXContext() const
bool isInExternCXXContext() const
Description
Determines whether this function's context is, or is nested within, a C++ extern "C++" linkage spec.
Declared at: clang/include/clang/AST/Decl.h:2442
¶bool isIneligibleOrNotSelected() const
bool isIneligibleOrNotSelected() const
Declared at: clang/include/clang/AST/Decl.h:2258
¶bool isInlineBuiltinDeclaration() const
bool isInlineBuiltinDeclaration() const
Description
Determine if this function provides an inline implementation of a builtin.
Declared at: clang/include/clang/AST/Decl.h:2424
¶bool isInlineDefinitionExternallyVisible() const
bool isInlineDefinitionExternallyVisible() const
Declared at: clang/include/clang/AST/Decl.h:2646
¶bool isInlineSpecified() const
bool isInlineSpecified() const
Description
Determine whether the "inline" keyword was specified for this function.
Declared at: clang/include/clang/AST/Decl.h:2622
¶bool isInlined() const
bool isInlined() const
Description
Determine whether this function should be inlined, because it is either marked "inline" or "constexpr" or is a member function of a class that was defined in the class body.
Declared at: clang/include/clang/AST/Decl.h:2644
¶bool isLateTemplateParsed() const
bool isLateTemplateParsed() const
Description
Whether this templated function will be late parsed.
Declared at: clang/include/clang/AST/Decl.h:2214
¶bool isMSExternInline() const
bool isMSExternInline() const
Declared at: clang/include/clang/AST/Decl.h:2648
¶bool isMSVCRTEntryPoint() const
bool isMSVCRTEntryPoint() const
Description
Determines whether this function is a MSVCRT user defined entry point.
Declared at: clang/include/clang/AST/Decl.h:2381
¶bool isMain() const
bool isMain() const
Description
Determines whether this function is "main", which is the entry point into an executable program.
Declared at: clang/include/clang/AST/Decl.h:2377
¶bool isMultiVersion() const
bool isMultiVersion() const
Description
True if this function is considered a multiversioned function.
Declared at: clang/include/clang/AST/Decl.h:2462
¶bool isNoReturn() const
bool isNoReturn() const
Description
Determines whether this function is known to be 'noreturn', through an attribute on its declaration or its type.
Declared at: clang/include/clang/AST/Decl.h:2449
¶bool isOutOfLine() const
bool isOutOfLine() const
Description
Determine whether this is or was instantiated from an out-of-line definition of a member function.
Declared at: clang/include/clang/AST/Decl.h:2843
¶bool isOverloadedOperator() const
bool isOverloadedOperator() const
Description
Whether this function declaration represents an C++ overloaded operator, e.g., "operator+".
Declared at: clang/include/clang/AST/Decl.h:2656
¶bool isPure() const
bool isPure() const
Description
Whether this virtual function is pure, i.e. makes the containing class abstract.
Declared at: clang/include/clang/AST/Decl.h:2210
¶bool isReplaceableGlobalAllocationFunction(
Optional<unsigned int>* AlignmentParam =
nullptr,
bool* IsNothrow = nullptr) const
bool isReplaceableGlobalAllocationFunction(
Optional<unsigned int>* AlignmentParam =
nullptr,
bool* IsNothrow = nullptr) const
Description
Determines whether this function is one of the replaceable global allocation functions: void *operator new(size_t); void *operator new(size_t, const std::nothrow_t & ) noexcept; void *operator new[](size_t); void *operator new[](size_t, const std::nothrow_t & ) noexcept; void operator delete(void *) noexcept; void operator delete(void *, std::size_t) noexcept; [C++1y] void operator delete(void *, const std::nothrow_t & ) noexcept; void operator delete[](void *) noexcept; void operator delete[](void *, std::size_t) noexcept; [C++1y] void operator delete[](void *, const std::nothrow_t & ) noexcept; These functions have special behavior under C++1y [expr.new]: An implementation is allowed to omit a call to a replaceable global allocation function. [...] If this function is an aligned allocation/deallocation function, return the parameter number of the requested alignment through AlignmentParam. If this function is an allocation/deallocation function that takes the `std::nothrow_t` tag, return true through IsNothrow,
Declared at: clang/include/clang/AST/Decl.h:2419
Parameters
- Optional<unsigned int>* AlignmentParam = nullptr
- bool* IsNothrow = nullptr
¶bool isReservedGlobalPlacementOperator() const
bool isReservedGlobalPlacementOperator() const
Description
Determines whether this operator new or delete is one of the reserved global placement operators: void *operator new(size_t, void *); void *operator new[](size_t, void *); void operator delete(void *, void *); void operator delete[](void *, void *); These functions have special behavior under [new.delete.placement]: These functions are reserved, a C++ program may not define functions that displace the versions in the Standard C++ library. The provisions of [basic.stc.dynamic] do not apply to these reserved placement forms of operator new and operator delete. This function must be an allocation or deallocation function.
Declared at: clang/include/clang/AST/Decl.h:2396
¶bool isStatic() const
bool isStatic() const
Declared at: clang/include/clang/AST/Decl.h:2652
¶bool isTargetClonesMultiVersion() const
bool isTargetClonesMultiVersion() const
Description
True if this function is a multiversioned dispatch function as a part of the target-clones functionality.
Declared at: clang/include/clang/AST/Decl.h:2491
¶bool isTargetMultiVersion() const
bool isTargetMultiVersion() const
Description
True if this function is a multiversioned dispatch function as a part of the target functionality.
Declared at: clang/include/clang/AST/Decl.h:2487
¶bool isTemplateInstantiation() const
bool isTemplateInstantiation() const
Description
Determines if the given function was instantiated from a function template.
Declared at: clang/include/clang/AST/Decl.h:2743
¶bool isThisDeclarationADefinition() const
bool isThisDeclarationADefinition() const
Description
Returns whether this specific declaration of the function is also a definition that does not contain uninstantiated body. This does not determine whether the function has been defined (e.g., in a previous definition); for that information, use isDefined. Note: the function declaration does not become a definition until the parser reaches the definition, if called before, this function will return `false`.
Declared at: clang/include/clang/AST/Decl.h:2171
¶bool isThisDeclarationInstantiatedFromAFriendDefinition()
const
bool isThisDeclarationInstantiatedFromAFriendDefinition()
const
Description
Determine whether this specific declaration of the function is a friend declaration that was instantiated from a function definition. Such declarations behave like definitions in some contexts.
Declared at: clang/include/clang/AST/Decl.h:2180
¶bool isTrivial() const
bool isTrivial() const
Description
Whether this function is "trivial" in some specialized C++ senses. Can only be true for default constructors, copy constructors, copy assignment operators, and destructors. Not meaningful until the class has been fully built by Sema.
Declared at: clang/include/clang/AST/Decl.h:2227
¶bool isTrivialForCall() const
bool isTrivialForCall() const
Declared at: clang/include/clang/AST/Decl.h:2230
¶bool isUserProvided() const
bool isUserProvided() const
Description
True if this method is user-declared and was not deleted or defaulted on its first declaration.
Declared at: clang/include/clang/AST/Decl.h:2250
¶bool isVariadic() const
bool isVariadic() const
Description
Whether this function is variadic.
Declared at: clang/include/clang/AST/Decl.h:2198
¶bool isVirtualAsWritten() const
bool isVirtualAsWritten() const
Description
Whether this function is marked as virtual explicitly.
Declared at: clang/include/clang/AST/Decl.h:2201
¶clang::FunctionDecl::param_iterator param_begin()
clang::FunctionDecl::param_iterator param_begin()
Declared at: clang/include/clang/AST/Decl.h:2526
¶clang::FunctionDecl::param_const_iterator
param_begin() const
clang::FunctionDecl::param_const_iterator
param_begin() const
Declared at: clang/include/clang/AST/Decl.h:2528
¶bool param_empty() const
bool param_empty() const
Declared at: clang/include/clang/AST/Decl.h:2525
¶clang::FunctionDecl::param_iterator param_end()
clang::FunctionDecl::param_iterator param_end()
Declared at: clang/include/clang/AST/Decl.h:2527
¶clang::FunctionDecl::param_const_iterator
param_end() const
clang::FunctionDecl::param_const_iterator
param_end() const
Declared at: clang/include/clang/AST/Decl.h:2529
¶size_t param_size() const
size_t param_size() const
Declared at: clang/include/clang/AST/Decl.h:2530
¶ArrayRef<clang::ParmVarDecl*> parameters() const
ArrayRef<clang::ParmVarDecl*> parameters() const
Declared at: clang/include/clang/AST/Decl.h:2514
¶MutableArrayRef<clang::ParmVarDecl*> parameters()
MutableArrayRef<clang::ParmVarDecl*> parameters()
Declared at: clang/include/clang/AST/Decl.h:2517
¶void setBody(clang::Stmt* B)
void setBody(clang::Stmt* B)
Declared at: clang/include/clang/AST/Decl.h:2188
Parameters
- clang::Stmt* B
¶void setConstexprKind(
clang::ConstexprSpecKind CSK)
void setConstexprKind(
clang::ConstexprSpecKind CSK)
Declared at: clang/include/clang/AST/Decl.h:2313
Parameters
- clang::ConstexprSpecKind CSK
¶void setDefaulted(bool D = true)
void setDefaulted(bool D = true)
Declared at: clang/include/clang/AST/Decl.h:2236
Parameters
- bool D = true
¶void setDefaultedFunctionInfo(
clang::FunctionDecl::DefaultedFunctionInfo*
Info)
void setDefaultedFunctionInfo(
clang::FunctionDecl::DefaultedFunctionInfo*
Info)
Declared at: clang/include/clang/AST/Decl.h:2194
Parameters
¶void setDeletedAsWritten(bool D = true)
void setDeletedAsWritten(bool D = true)
Declared at: clang/include/clang/AST/Decl.h:2373
Parameters
- bool D = true
¶void setDependentTemplateSpecialization(
clang::ASTContext& Context,
const clang::UnresolvedSetImpl& Templates,
const clang::TemplateArgumentListInfo&
TemplateArgs)
void setDependentTemplateSpecialization(
clang::ASTContext& Context,
const clang::UnresolvedSetImpl& Templates,
const clang::TemplateArgumentListInfo&
TemplateArgs)
Description
Specifies that this function declaration is actually a dependent function template specialization.
Declared at: clang/include/clang/AST/Decl.h:2812
Parameters
- clang::ASTContext& Context
- const clang::UnresolvedSetImpl& Templates
- const clang::TemplateArgumentListInfo& TemplateArgs
¶void setDescribedFunctionTemplate(
clang::FunctionTemplateDecl* Template)
void setDescribedFunctionTemplate(
clang::FunctionTemplateDecl* Template)
Declared at: clang/include/clang/AST/Decl.h:2723
Parameters
- clang::FunctionTemplateDecl* Template
¶void setExplicitlyDefaulted(bool ED = true)
void setExplicitlyDefaulted(bool ED = true)
Description
State that this function is explicitly defaulted.
Declared at: clang/include/clang/AST/Decl.h:2244
Parameters
- bool ED = true
¶void setFunctionTemplateSpecialization(
clang::ASTContext& C,
clang::FunctionTemplateDecl* Template,
const clang::TemplateArgumentList*
TemplateArgs,
void* InsertPos,
clang::TemplateSpecializationKind TSK,
const clang::TemplateArgumentListInfo*
TemplateArgsAsWritten,
clang::SourceLocation PointOfInstantiation)
void setFunctionTemplateSpecialization(
clang::ASTContext& C,
clang::FunctionTemplateDecl* Template,
const clang::TemplateArgumentList*
TemplateArgs,
void* InsertPos,
clang::TemplateSpecializationKind TSK,
const clang::TemplateArgumentListInfo*
TemplateArgsAsWritten,
clang::SourceLocation PointOfInstantiation)
Description
Specify that this function declaration is actually a function template specialization.
Declared at: clang/include/clang/AST/Decl.h:1986
Parameters
- clang::ASTContext& C
- the ASTContext.
- clang::FunctionTemplateDecl* Template
- the function template that this function template specialization specializes.
- const clang::TemplateArgumentList* TemplateArgs
- the template arguments that produced this function template specialization from the template.
- void* InsertPos
- If non-NULL, the position in the function template specialization set where the function template specialization data will be inserted.
- clang::TemplateSpecializationKind TSK
- the kind of template specialization this is.
- const clang::TemplateArgumentListInfo* TemplateArgsAsWritten
- location info of template arguments.
- clang::SourceLocation PointOfInstantiation
- point at which the function template specialization was first instantiated.
¶void setFunctionTemplateSpecialization(
clang::FunctionTemplateDecl* Template,
const clang::TemplateArgumentList*
TemplateArgs,
void* InsertPos,
clang::TemplateSpecializationKind TSK =
TSK_ImplicitInstantiation,
const clang::TemplateArgumentListInfo*
TemplateArgsAsWritten = nullptr,
clang::SourceLocation PointOfInstantiation =
clang::SourceLocation())
void setFunctionTemplateSpecialization(
clang::FunctionTemplateDecl* Template,
const clang::TemplateArgumentList*
TemplateArgs,
void* InsertPos,
clang::TemplateSpecializationKind TSK =
TSK_ImplicitInstantiation,
const clang::TemplateArgumentListInfo*
TemplateArgsAsWritten = nullptr,
clang::SourceLocation PointOfInstantiation =
clang::SourceLocation())
Description
Specify that this function declaration is actually a function template specialization.
Declared at: clang/include/clang/AST/Decl.h:2799
Parameters
- clang::FunctionTemplateDecl* Template
- the function template that this function template specialization specializes.
- const clang::TemplateArgumentList* TemplateArgs
- the template arguments that produced this function template specialization from the template.
- void* InsertPos
- If non-NULL, the position in the function template specialization set where the function template specialization data will be inserted.
- clang::TemplateSpecializationKind TSK = TSK_ImplicitInstantiation
- the kind of template specialization this is.
- const clang::TemplateArgumentListInfo* TemplateArgsAsWritten = nullptr
- location info of template arguments.
- clang::SourceLocation PointOfInstantiation = clang::SourceLocation()
- point at which the function template specialization was first instantiated.
¶void setHasImplicitReturnZero(bool IRZ)
void setHasImplicitReturnZero(bool IRZ)
Description
State that falling off this function implicitly returns null/zero. If a more specific implicit return value is required, front-ends should synthesize the appropriate return statements.
Declared at: clang/include/clang/AST/Decl.h:2275
Parameters
- bool IRZ
¶void setHasInheritedPrototype(bool P = true)
void setHasInheritedPrototype(bool P = true)
Description
State that this function inherited its prototype from a previous declaration.
Declared at: clang/include/clang/AST/Decl.h:2305
Parameters
- bool P = true
¶void setHasODRHash(bool B = true)
void setHasODRHash(bool B = true)
Description
State that an ODRHash has been stored.
Declared at: clang/include/clang/AST/Decl.h:2010
Parameters
- bool B = true
¶void setHasSkippedBody(bool Skipped = true)
void setHasSkippedBody(bool Skipped = true)
Declared at: clang/include/clang/AST/Decl.h:2453
Parameters
- bool Skipped = true
¶void setHasWrittenPrototype(bool P = true)
void setHasWrittenPrototype(bool P = true)
Description
State that this function has a written prototype.
Declared at: clang/include/clang/AST/Decl.h:2293
Parameters
- bool P = true
¶void setImplicitlyInline(bool I = true)
void setImplicitlyInline(bool I = true)
Description
Flag that this function is implicitly inline.
Declared at: clang/include/clang/AST/Decl.h:2639
Parameters
- bool I = true
¶void setIneligibleOrNotSelected(bool II)
void setIneligibleOrNotSelected(bool II)
Declared at: clang/include/clang/AST/Decl.h:2261
Parameters
- bool II
¶void setInlineSpecified(bool I)
void setInlineSpecified(bool I)
Description
Set whether the "inline" keyword was specified for this function.
Declared at: clang/include/clang/AST/Decl.h:2625
Parameters
- bool I
¶void setInstantiatedFromDecl(
clang::FunctionDecl* FD)
void setInstantiatedFromDecl(
clang::FunctionDecl* FD)
Description
Specify that this function declaration was instantiated from a FunctionDecl FD. This is only used if this is a function declaration declared locally inside of a function template.
Declared at: clang/include/clang/AST/Decl.h:2705
Parameters
¶void setInstantiationIsPending(bool IC)
void setInstantiationIsPending(bool IC)
Description
State that the instantiation of this function is pending. (see instantiationIsPending)
Declared at: clang/include/clang/AST/Decl.h:2338
Parameters
- bool IC
¶void setInstantiationOfMemberFunction(
clang::ASTContext& C,
clang::FunctionDecl* FD,
clang::TemplateSpecializationKind TSK)
void setInstantiationOfMemberFunction(
clang::ASTContext& C,
clang::FunctionDecl* FD,
clang::TemplateSpecializationKind TSK)
Description
Specify that this record is an instantiation of the member function FD.
Declared at: clang/include/clang/AST/Decl.h:1996
Parameters
- clang::ASTContext& C
- clang::FunctionDecl* FD
- clang::TemplateSpecializationKind TSK
¶void setInstantiationOfMemberFunction(
clang::FunctionDecl* FD,
clang::TemplateSpecializationKind TSK)
void setInstantiationOfMemberFunction(
clang::FunctionDecl* FD,
clang::TemplateSpecializationKind TSK)
Description
Specify that this record is an instantiation of the member function FD.
Declared at: clang/include/clang/AST/Decl.h:2697
Parameters
- clang::FunctionDecl* FD
- clang::TemplateSpecializationKind TSK
¶void setIsMultiVersion(bool V = true)
void setIsMultiVersion(bool V = true)
Description
Sets the multiversion state for this declaration and all of its redeclarations.
Declared at: clang/include/clang/AST/Decl.h:2468
Parameters
- bool V = true
¶void setLateTemplateParsed(bool ILT = true)
void setLateTemplateParsed(bool ILT = true)
Description
State that this templated function will be late parsed.
Declared at: clang/include/clang/AST/Decl.h:2219
Parameters
- bool ILT = true
¶void setLazyBody(uint64_t Offset)
void setLazyBody(uint64_t Offset)
Declared at: clang/include/clang/AST/Decl.h:2189
Parameters
- uint64_t Offset
¶void setParams(
clang::ASTContext& C,
ArrayRef<clang::ParmVarDecl*> NewParamInfo)
void setParams(
clang::ASTContext& C,
ArrayRef<clang::ParmVarDecl*> NewParamInfo)
Declared at: clang/include/clang/AST/Decl.h:1999
Parameters
- clang::ASTContext& C
- ArrayRef<clang::ParmVarDecl*> NewParamInfo
¶void setParams(
ArrayRef<clang::ParmVarDecl*> NewParamInfo)
void setParams(
ArrayRef<clang::ParmVarDecl*> NewParamInfo)
Declared at: clang/include/clang/AST/Decl.h:2545
Parameters
- ArrayRef<clang::ParmVarDecl*> NewParamInfo
¶void setPreviousDeclaration(
clang::FunctionDecl* PrevDecl)
void setPreviousDeclaration(
clang::FunctionDecl* PrevDecl)
Declared at: clang/include/clang/AST/Decl.h:2504
Parameters
- clang::FunctionDecl* PrevDecl
¶void setPure(bool P = true)
void setPure(bool P = true)
Declared at: clang/include/clang/AST/Decl.h:2211
Parameters
- bool P = true
¶void setRangeEnd(clang::SourceLocation E)
void setRangeEnd(clang::SourceLocation E)
Declared at: clang/include/clang/AST/Decl.h:2077
Parameters
¶void setStorageClass(clang::StorageClass SClass)
void setStorageClass(clang::StorageClass SClass)
Description
Sets the storage class as written in the source.
Declared at: clang/include/clang/AST/Decl.h:2616
Parameters
- clang::StorageClass SClass
¶void setTemplateSpecializationKind(
clang::TemplateSpecializationKind TSK,
clang::SourceLocation PointOfInstantiation =
clang::SourceLocation())
void setTemplateSpecializationKind(
clang::TemplateSpecializationKind TSK,
clang::SourceLocation PointOfInstantiation =
clang::SourceLocation())
Description
Determine what kind of template instantiation this function represents.
Declared at: clang/include/clang/AST/Decl.h:2830
Parameters
- clang::TemplateSpecializationKind TSK
- clang::SourceLocation PointOfInstantiation = clang::SourceLocation()
¶void setTrivial(bool IT)
void setTrivial(bool IT)
Declared at: clang/include/clang/AST/Decl.h:2228
Parameters
- bool IT
¶void setTrivialForCall(bool IT)
void setTrivialForCall(bool IT)
Declared at: clang/include/clang/AST/Decl.h:2231
Parameters
- bool IT
¶void setUsesFPIntrin(bool I)
void setUsesFPIntrin(bool I)
Description
Set whether the function was declared in source context that requires constrained FP intrinsics
Declared at: clang/include/clang/AST/Decl.h:2636
Parameters
- bool I
¶void setUsesSEHTry(bool UST)
void setUsesSEHTry(bool UST)
Declared at: clang/include/clang/AST/Decl.h:2344
Parameters
- bool UST
¶void setVirtualAsWritten(bool V)
void setVirtualAsWritten(bool V)
Description
State that this function is marked as virtual explicitly.
Declared at: clang/include/clang/AST/Decl.h:2206
Parameters
- bool V
¶void setWillHaveBody(bool V = true)
void setWillHaveBody(bool V = true)
Declared at: clang/include/clang/AST/Decl.h:2459
Parameters
- bool V = true
¶bool usesSEHTry() const
bool usesSEHTry() const
Description
Indicates the function uses __try.
Declared at: clang/include/clang/AST/Decl.h:2343
¶bool willHaveBody() const
bool willHaveBody() const
Description
True if this function will eventually have a body, once it's fully parsed.
Declared at: clang/include/clang/AST/Decl.h:2458