clang API Documentation
ParmVarDecl - Represents a parameter to a function. More...
#include <Decl.h>
ParmVarDecl - Represents a parameter to a function.
clang::ParmVarDecl::ParmVarDecl | ( | Kind | DK, |
ASTContext & | C, | ||
DeclContext * | DC, | ||
SourceLocation | StartLoc, | ||
SourceLocation | IdLoc, | ||
IdentifierInfo * | Id, | ||
QualType | T, | ||
TypeSourceInfo * | TInfo, | ||
StorageClass | S, | ||
Expr * | DefArg | ||
) | [inline, protected] |
Definition at line 1254 of file Decl.h.
Referenced by Create(), and CreateDeserialized().
static bool clang::ParmVarDecl::classof | ( | const Decl * | D | ) | [inline, static] |
Reimplemented from clang::VarDecl.
Definition at line 1403 of file Decl.h.
References clang::Decl::getKind().
static bool clang::ParmVarDecl::classofKind | ( | Kind | K | ) | [inline, static] |
Reimplemented from clang::VarDecl.
ParmVarDecl * ParmVarDecl::Create | ( | ASTContext & | C, |
DeclContext * | DC, | ||
SourceLocation | StartLoc, | ||
SourceLocation | IdLoc, | ||
IdentifierInfo * | Id, | ||
QualType | T, | ||
TypeSourceInfo * | TInfo, | ||
StorageClass | S, | ||
Expr * | DefArg | ||
) | [static] |
Definition at line 2203 of file Decl.cpp.
References AttributeLangSupport::C, and ParmVarDecl().
Referenced by addFunctionPointerConversion(), clang::Sema::BuildBlockForLambdaConversion(), clang::Sema::BuildObjCArrayLiteral(), clang::Sema::BuildObjCBoxedExpr(), clang::Sema::BuildObjCDictionaryLiteral(), clang::Sema::BuildParmVarDeclForTypedef(), clang::Sema::CheckParameter(), clang::Sema::DeclareGlobalAllocationFunction(), clang::Sema::DeclareImplicitCopyAssignment(), clang::Sema::DeclareImplicitCopyConstructor(), clang::Sema::DeclareImplicitMoveAssignment(), clang::Sema::DeclareImplicitMoveConstructor(), getNSNumberFactoryMethod(), clang::Sema::LazilyCreateBuiltin(), clang::Sema::MergeFunctionDecl(), clang::Sema::ProcessPropertyDecl(), clang::TreeTransform< Derived >::TransformFunctionTypeParam(), and clang::ASTNodeImporter::VisitParmVarDecl().
ParmVarDecl * ParmVarDecl::CreateDeserialized | ( | ASTContext & | C, |
unsigned | ID | ||
) | [static] |
Reimplemented from clang::VarDecl.
Definition at line 2220 of file Decl.cpp.
References AttributeLangSupport::C, ParmVarDecl(), and clang::SC_None.
Definition at line 2241 of file Decl.cpp.
References clang::VarDecl::getInit(), hasUninstantiatedDefaultArg(), and hasUnparsedDefaultArg().
Referenced by clang::Sema::BuildCXXDefaultArgExpr(), clang::Sema::CheckExtraCXXDefaultArguments(), clang::CXXDefaultArgExpr::getExpr(), and clang::Sema::SubstParmVarDecl().
const Expr* clang::ParmVarDecl::getDefaultArg | ( | ) | const [inline] |
SourceRange ParmVarDecl::getDefaultArgRange | ( | ) | const |
Retrieve the source range that covers the entire default argument.
Definition at line 2253 of file Decl.cpp.
References clang::VarDecl::getInit(), clang::Stmt::getSourceRange(), getUninstantiatedDefaultArg(), and hasUninstantiatedDefaultArg().
Referenced by CheckOperatorNewDeclaration(), getSourceRange(), and clang::Sema::MergeCXXFunctionDecl().
unsigned clang::ParmVarDecl::getFunctionScopeDepth | ( | ) | const [inline] |
Definition at line 1294 of file Decl.h.
Referenced by clang::Sema::SubstParmVarDecl(), clang::TreeTransform< Derived >::TransformFunctionTypeParam(), and clang::ASTDeclWriter::VisitParmVarDecl().
unsigned clang::ParmVarDecl::getFunctionScopeIndex | ( | ) | const [inline] |
Returns the index of this parameter in its prototype or method scope.
Definition at line 1300 of file Decl.h.
Referenced by mergeParamDeclAttributes(), clang::Sema::SubstParmVarDecl(), clang::TreeTransform< Derived >::TransformFunctionTypeParam(), clang::ento::FindLastStoreBRVisitor::VisitNode(), and clang::ASTDeclWriter::VisitParmVarDecl().
ObjCDeclQualifier clang::ParmVarDecl::getObjCDeclQualifier | ( | ) | const [inline] |
Definition at line 1304 of file Decl.h.
Referenced by CheckMethodOverrideParam(), FormatFunctionParameter(), clang::ASTContext::getObjCEncodingForMethodDecl(), clang::ASTContext::ObjCMethodsAreEqual(), and clang::ASTDeclWriter::VisitParmVarDecl().
QualType ParmVarDecl::getOriginalType | ( | ) | const |
Definition at line 2212 of file Decl.cpp.
References clang::TypeSourceInfo::getType(), clang::ValueDecl::getType(), and clang::DeclaratorDecl::getTypeSourceInfo().
Referenced by clang::Sema::CheckParmsForFunctionDef(), clang::Sema::CheckStaticArrayArgument(), clang::CodeCompleteConsumer::OverloadCandidate::CreateSignatureString(), and clang::ASTContext::getObjCEncodingForMethodDecl().
SourceRange ParmVarDecl::getSourceRange | ( | ) | const [override, virtual] |
Source range that this declaration covers.
Reimplemented from clang::VarDecl.
Definition at line 2226 of file Decl.cpp.
References clang::Decl::getDeclContext(), getDefaultArgRange(), clang::SourceRange::getEnd(), clang::Decl::getLocation(), clang::DeclaratorDecl::getLocStart(), clang::DeclaratorDecl::getOuterLocStart(), hasInheritedDefaultArg(), and clang::SourceRange::isValid().
Referenced by CheckConstexprParameterTypes(), handleNonNullAttrParameter(), and clang::Sema::SpecialMemberIsTrivial().
Expr* clang::ParmVarDecl::getUninstantiatedDefaultArg | ( | ) | [inline] |
Definition at line 1343 of file Decl.h.
Referenced by clang::Sema::BuildCXXDefaultArgExpr(), getDefaultArgRange(), clang::Sema::MergeCXXFunctionDecl(), clang::Sema::SubstParmVarDecl(), and clang::ASTDeclWriter::VisitParmVarDecl().
const Expr* clang::ParmVarDecl::getUninstantiatedDefaultArg | ( | ) | const [inline] |
bool clang::ParmVarDecl::hasDefaultArg | ( | ) | const [inline] |
hasDefaultArg - Determines whether this parameter has a default argument, either parsed or not.
Definition at line 1352 of file Decl.h.
Referenced by AddFunctionParameterChunks(), clang::Sema::CheckConstructor(), clang::Sema::CheckCXXDefaultArguments(), CheckOperatorNewDeclaration(), functionDeclHasDefaultArgument(), clang::CXXConstructorDecl::isConvertingConstructor(), clang::CXXConstructorDecl::isDefaultConstructor(), clang::Sema::isInitListConstructor(), clang::Sema::MergeCXXFunctionDecl(), and NeedsInstantiationAsFunctionType().
bool clang::ParmVarDecl::hasInheritedDefaultArg | ( | ) | const [inline] |
Definition at line 1382 of file Decl.h.
Referenced by functionDeclHasDefaultArgument(), getSourceRange(), clang::Sema::SubstParmVarDecl(), clang::ASTDeclWriter::VisitParmVarDecl(), and clang::ASTNodeImporter::VisitParmVarDecl().
bool clang::ParmVarDecl::hasUninstantiatedDefaultArg | ( | ) | const [inline] |
Definition at line 1371 of file Decl.h.
Referenced by clang::Sema::BuildCXXDefaultArgExpr(), getDefaultArg(), getDefaultArgRange(), clang::Sema::MergeCXXFunctionDecl(), clang::Sema::SubstParmVarDecl(), and clang::ASTDeclWriter::VisitParmVarDecl().
bool clang::ParmVarDecl::hasUnparsedDefaultArg | ( | ) | const [inline] |
hasUnparsedDefaultArg - 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.,
class X { public: void f(int x = 17); // x has an unparsed default argument now }; // x has a regular default argument now
Definition at line 1367 of file Decl.h.
Referenced by clang::Sema::ActOnDelayedCXXMethodParameter(), clang::Sema::BuildCXXDefaultArgExpr(), clang::Sema::CheckExtraCXXDefaultArguments(), getDefaultArg(), and clang::Sema::SubstParmVarDecl().
bool clang::ParmVarDecl::isKNRPromoted | ( | ) | const [inline] |
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.
Definition at line 1321 of file Decl.h.
Referenced by clang::ASTDeclWriter::VisitParmVarDecl().
bool clang::ParmVarDecl::isObjCMethodParameter | ( | ) | const [inline] |
Definition at line 1290 of file Decl.h.
Referenced by clang::ASTDeclWriter::VisitParmVarDecl().
bool ParmVarDecl::isParameterPack | ( | ) | const |
Determine whether this parameter is actually a function parameter pack.
Reimplemented from clang::Decl.
Definition at line 2263 of file Decl.cpp.
References clang::ValueDecl::getType().
Referenced by addInstantiatedParametersToScope(), clang::CXXConstructorDecl::isConvertingConstructor(), isVariadicFunctionTemplate(), clang::TemplateDeclInstantiator::SubstFunctionType(), and clang::Sema::SubstParmVarDecl().
void clang::ParmVarDecl::setDefaultArg | ( | Expr * | defarg | ) | [inline] |
Definition at line 1333 of file Decl.h.
Referenced by clang::Sema::ActOnDelayedCXXMethodParameter(), clang::Sema::ActOnParamDefaultArgumentError(), clang::Sema::CheckCXXDefaultArguments(), clang::Sema::CheckExtraCXXDefaultArguments(), clang::Sema::MergeCXXFunctionDecl(), and clang::Sema::SetParamDefaultArgument().
void clang::ParmVarDecl::setHasInheritedDefaultArg | ( | bool | I = true | ) | [inline] |
Definition at line 1386 of file Decl.h.
Referenced by clang::Sema::MergeCXXFunctionDecl(), clang::Sema::SubstParmVarDecl(), and clang::ASTNodeImporter::VisitParmVarDecl().
void clang::ParmVarDecl::setKNRPromoted | ( | bool | promoted | ) | [inline] |
Definition at line 1324 of file Decl.h.
Referenced by GetFullTypeForDeclarator().
void clang::ParmVarDecl::setObjCDeclQualifier | ( | ObjCDeclQualifier | QTVal | ) | [inline] |
Definition at line 1308 of file Decl.h.
Referenced by clang::Sema::ActOnMethodDeclaration().
void clang::ParmVarDecl::setObjCMethodScopeInfo | ( | unsigned | parameterIndex | ) | [inline] |
Definition at line 1275 of file Decl.h.
Referenced by clang::Sema::ActOnMethodDeclaration(), and clang::ASTDeclReader::VisitParmVarDecl().
void clang::ParmVarDecl::setOwningFunction | ( | DeclContext * | FD | ) | [inline] |
setOwningFunction - 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.
Definition at line 1400 of file Decl.h.
Referenced by clang::ASTNodeImporter::VisitObjCMethodDecl().
void clang::ParmVarDecl::setScopeInfo | ( | unsigned | scopeDepth, |
unsigned | parameterIndex | ||
) | [inline] |
Definition at line 1280 of file Decl.h.
Referenced by clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnParamDeclarator(), clang::Sema::DeclClonePragmaWeak(), clang::Sema::LazilyCreateBuiltin(), clang::Sema::MergeFunctionDecl(), clang::Sema::SubstParmVarDecl(), clang::TreeTransform< Derived >::TransformFunctionTypeParam(), and clang::ASTDeclReader::VisitParmVarDecl().
void clang::ParmVarDecl::setUninstantiatedDefaultArg | ( | Expr * | arg | ) | [inline] |
Definition at line 1340 of file Decl.h.
Referenced by clang::Sema::MergeCXXFunctionDecl(), clang::Sema::SubstParmVarDecl(), and clang::ASTDeclReader::VisitParmVarDecl().
void clang::ParmVarDecl::setUnparsedDefaultArg | ( | ) | [inline] |
setUnparsedDefaultArg - 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.
Definition at line 1380 of file Decl.h.
Referenced by clang::Sema::ActOnParamUnparsedDefaultArgument(), and clang::Sema::SubstParmVarDecl().