class ParmVarDecl

Declaration

class ParmVarDecl : public VarDecl { /* full declaration omitted */ };

Description

Represents a parameter to a function.

Declared at: clang/include/clang/AST/Decl.h:1680

Inherits from: VarDecl

Member Variables

Inherited from VarDecl:

protected Init
protected

Inherited from Decl:

protected NextInContextAndBits
protected Access
protected FromASTFile
protected IdentifierNamespace
protected CacheValidAndLinkage

Method Overview

Inherited from VarDecl:

Inherited from DeclaratorDecl:

Inherited from ValueDecl:

Inherited from NamedDecl:

Inherited from Decl:

Methods

static clang::ParmVarDecl* Create(
    clang::ASTContext& C,
    clang::DeclContext* DC,
    clang::SourceLocation StartLoc,
    clang::SourceLocation IdLoc,
    clang::IdentifierInfo* Id,
    clang::QualType T,
    clang::TypeSourceInfo* TInfo,
    clang::StorageClass S,
    clang::Expr* DefArg)

Declared at: clang/include/clang/AST/Decl.h:1698

Parameters

clang::ASTContext& C
clang::DeclContext* DC
clang::SourceLocation StartLoc
clang::SourceLocation IdLoc
clang::IdentifierInfo* Id
clang::QualType T
clang::TypeSourceInfo* TInfo
clang::StorageClass S
clang::Expr* DefArg

static clang::ParmVarDecl* CreateDeserialized(
    clang::ASTContext& C,
    unsigned int ID)

Declared at: clang/include/clang/AST/Decl.h:1704

Parameters

clang::ASTContext& C
unsigned int ID

ParmVarDecl(clang::Decl::Kind DK,
            clang::ASTContext& C,
            clang::DeclContext* DC,
            clang::SourceLocation StartLoc,
            clang::SourceLocation IdLoc,
            clang::IdentifierInfo* Id,
            clang::QualType T,
            clang::TypeSourceInfo* TInfo,
            clang::StorageClass S,
            clang::Expr* DefArg)

Declared at: clang/include/clang/AST/Decl.h:1686

Parameters

clang::Decl::Kind DK
clang::ASTContext& C
clang::DeclContext* DC
clang::SourceLocation StartLoc
clang::SourceLocation IdLoc
clang::IdentifierInfo* Id
clang::QualType T
clang::TypeSourceInfo* TInfo
clang::StorageClass S
clang::Expr* DefArg

static bool classof(const clang::Decl* D)

Declared at: clang/include/clang/AST/Decl.h:1830

Parameters

const clang::Decl* D

static bool classofKind(clang::Decl::Kind K)

Declared at: clang/include/clang/AST/Decl.h:1831

Parameters

clang::Decl::Kind K

const clang::Expr* getDefaultArg() const

Declared at: clang/include/clang/AST/Decl.h:1769

clang::Expr* getDefaultArg()

Declared at: clang/include/clang/AST/Decl.h:1768

clang::SourceRange getDefaultArgRange() const

Description

Retrieve the source range that covers the entire default argument.

Declared at: clang/include/clang/AST/Decl.h:1777

unsigned int getFunctionScopeDepth() const

Declared at: clang/include/clang/AST/Decl.h:1730

unsigned int getFunctionScopeIndex() const

Description

Returns the index of this parameter in its prototype or method scope.

Declared at: clang/include/clang/AST/Decl.h:1740

static constexpr unsigned int
getMaxFunctionScopeDepth()

Declared at: clang/include/clang/AST/Decl.h:1735

clang::Decl::ObjCDeclQualifier
getObjCDeclQualifier() const

Declared at: clang/include/clang/AST/Decl.h:1744

clang::QualType getOriginalType() const

Declared at: clang/include/clang/AST/Decl.h:1821

unsigned int getParameterIndex() const

Declared at: clang/include/clang/AST/Decl.h:1845

unsigned int getParameterIndexLarge() const

Declared at: clang/include/clang/AST/Decl.h:1851

clang::SourceRange getSourceRange() const

Description

Source range that this declaration covers.

Declared at: clang/include/clang/AST/Decl.h:1706

clang::Expr* getUninstantiatedDefaultArg()

Declared at: clang/include/clang/AST/Decl.h:1779

const clang::Expr* getUninstantiatedDefaultArg()
    const

Declared at: clang/include/clang/AST/Decl.h:1780

bool hasDefaultArg() const

Description

Determines whether this parameter has a default argument, either parsed or not.

Declared at: clang/include/clang/AST/Decl.h:1786

bool hasInheritedDefaultArg() const

Declared at: clang/include/clang/AST/Decl.h:1813

bool hasUninstantiatedDefaultArg() const

Declared at: clang/include/clang/AST/Decl.h:1801

bool hasUnparsedDefaultArg() const

Description

Determines whether this parameter has a default argument that has not yet been parsed. This will occur during the processing of a C++ class whose member functions have default arguments, e.g.,

Declared at: clang/include/clang/AST/Decl.h:1797

bool isDestroyedInCallee() const

Description

Determines whether this parameter is destroyed in the callee function.

Declared at: clang/include/clang/AST/Decl.h:1728

bool isKNRPromoted() const

Description

True if the value passed to this parameter must undergo K &R -style default argument promotion: C99 6.5.2.2. If the expression that denotes the called function has a type that does not include a prototype, the integer promotions are performed on each argument, and arguments that have type float are promoted to double.

Declared at: clang/include/clang/AST/Decl.h:1761

bool isObjCMethodParameter() const

Declared at: clang/include/clang/AST/Decl.h:1723

void setDefaultArg(clang::Expr* defarg)

Declared at: clang/include/clang/AST/Decl.h:1773

Parameters

clang::Expr* defarg

void setHasInheritedDefaultArg(bool I = true)

Declared at: clang/include/clang/AST/Decl.h:1817

Parameters

bool I = true

void setKNRPromoted(bool promoted)

Declared at: clang/include/clang/AST/Decl.h:1764

Parameters

bool promoted

void setObjCDeclQualifier(
    clang::Decl::ObjCDeclQualifier QTVal)

Declared at: clang/include/clang/AST/Decl.h:1748

Parameters

clang::Decl::ObjCDeclQualifier QTVal

void setObjCMethodScopeInfo(
    unsigned int parameterIndex)

Declared at: clang/include/clang/AST/Decl.h:1708

Parameters

unsigned int parameterIndex

void setOwningFunction(clang::DeclContext* FD)

Description

Sets the function declaration that owns this ParmVarDecl. Since ParmVarDecls are often created before the FunctionDecls that own them, this routine is required to update the DeclContext appropriately.

Declared at: clang/include/clang/AST/Decl.h:1827

Parameters

clang::DeclContext* FD

void setParameterIndex(
    unsigned int parameterIndex)

Declared at: clang/include/clang/AST/Decl.h:1836

Parameters

unsigned int parameterIndex

void setParameterIndexLarge(
    unsigned int parameterIndex)

Declared at: clang/include/clang/AST/Decl.h:1850

Parameters

unsigned int parameterIndex

void setScopeInfo(unsigned int scopeDepth,
                  unsigned int parameterIndex)

Declared at: clang/include/clang/AST/Decl.h:1713

Parameters

unsigned int scopeDepth
unsigned int parameterIndex

void setUninstantiatedDefaultArg(clang::Expr* arg)

Declared at: clang/include/clang/AST/Decl.h:1778

Parameters

clang::Expr* arg

void setUnparsedDefaultArg()

Description

Specify that this parameter has an unparsed default argument. The argument will be replaced with a real default argument via setDefaultArg when the class definition enclosing the function declaration that owns this default argument is completed.

Declared at: clang/include/clang/AST/Decl.h:1809