clang 22.0.0git
|
A stack-allocated class that identifies which local variable declaration instantiations are present in this scope. More...
#include "clang/Sema/Template.h"
Public Types | |
using | DeclArgumentPack = SmallVector<ValueDecl *, 4> |
A set of declarations. |
Public Member Functions | |
LocalInstantiationScope (Sema &SemaRef, bool CombineWithOuterScope=false, bool InstantiatingLambdaOrBlock=false) | |
LocalInstantiationScope (const LocalInstantiationScope &)=delete | |
LocalInstantiationScope & | operator= (const LocalInstantiationScope &)=delete |
~LocalInstantiationScope () | |
const Sema & | getSema () const |
void | Exit () |
Exit this local instantiation scope early. | |
LocalInstantiationScope * | cloneScopes (LocalInstantiationScope *Outermost) |
Clone this scope, and all outer scopes, down to the given outermost scope. | |
llvm::PointerUnion< Decl *, DeclArgumentPack * > * | findInstantiationOf (const Decl *D) |
Find the instantiation of the declaration D within the current instantiation scope. | |
llvm::PointerUnion< Decl *, DeclArgumentPack * > * | getInstantiationOfIfExists (const Decl *D) |
Similar to findInstantiationOf() , but it wouldn't assert if the instantiation was not found within the current instantiation scope. | |
void | InstantiatedLocal (const Decl *D, Decl *Inst) |
void | InstantiatedLocalPackArg (const Decl *D, VarDecl *Inst) |
void | MakeInstantiatedLocalArgPack (const Decl *D) |
void | SetPartiallySubstitutedPack (NamedDecl *Pack, const TemplateArgument *ExplicitArgs, unsigned NumExplicitArgs) |
Note that the given parameter pack has been partially substituted via explicit specification of template arguments (C++0x [temp.arg.explicit]p9). | |
void | ResetPartiallySubstitutedPack () |
Reset the partially-substituted pack when it is no longer of interest. | |
NamedDecl * | getPartiallySubstitutedPack (const TemplateArgument **ExplicitArgs=nullptr, unsigned *NumExplicitArgs=nullptr) const |
Retrieve the partially-substitued template parameter pack. | |
bool | isLocalPackExpansion (const Decl *D) |
Determine whether D is a pack expansion created in this scope. | |
bool | isLambdaOrBlock () const |
Determine whether this scope is for instantiating a lambda or block. |
Static Public Member Functions | |
static void | deleteScopes (LocalInstantiationScope *Scope, LocalInstantiationScope *Outermost) |
deletes the given scope, and all outer scopes, down to the given outermost scope. |
A stack-allocated class that identifies which local variable declaration instantiations are present in this scope.
A new instance of this class type will be created whenever we instantiate a new function declaration, which will have its own set of parameter declarations.
Definition at line 365 of file Template.h.
A set of declarations.
Definition at line 368 of file Template.h.
|
inline |
Definition at line 433 of file Template.h.
Referenced by cloneScopes(), deleteScopes(), getInstantiationOfIfExists(), getPartiallySubstitutedPack(), InstantiatedLocal(), LocalInstantiationScope(), MakeInstantiatedLocalArgPack(), and operator=().
|
delete |
References LocalInstantiationScope().
|
inline |
Definition at line 445 of file Template.h.
References Exit().
|
inline |
Clone this scope, and all outer scopes, down to the given outermost scope.
Definition at line 465 of file Template.h.
References clang::cast(), cloneScopes(), and LocalInstantiationScope().
Referenced by cloneScopes().
|
inlinestatic |
deletes the given scope, and all outer scopes, down to the given outermost scope.
Definition at line 505 of file Template.h.
References LocalInstantiationScope().
Referenced by clang::Sema::InstantiateClass().
|
inline |
Exit this local instantiation scope early.
Definition at line 452 of file Template.h.
Referenced by ~LocalInstantiationScope().
llvm::PointerUnion< Decl *, LocalInstantiationScope::DeclArgumentPack * > * LocalInstantiationScope::findInstantiationOf | ( | const Decl * | D | ) |
Find the instantiation of the declaration D within the current instantiation scope.
D | The declaration whose instantiation we are searching for. |
D
is instantiated, if found. Otherwise, returns NULL. Definition at line 4687 of file SemaTemplateInstantiate.cpp.
References clang::Decl::getDeclContext(), getInstantiationOfIfExists(), clang::isa(), and clang::Result.
llvm::PointerUnion< Decl *, LocalInstantiationScope::DeclArgumentPack * > * LocalInstantiationScope::getInstantiationOfIfExists | ( | const Decl * | D | ) |
Similar to findInstantiationOf()
, but it wouldn't assert if the instantiation was not found within the current instantiation scope.
This is helpful for on-demand declaration instantiation.
Definition at line 4658 of file SemaTemplateInstantiate.cpp.
References clang::Found, getCanonicalParmVarDecl(), clang::Decl::getPreviousDecl(), and LocalInstantiationScope().
Referenced by findInstantiationOf().
NamedDecl * LocalInstantiationScope::getPartiallySubstitutedPack | ( | const TemplateArgument ** | ExplicitArgs = nullptr, |
unsigned * | NumExplicitArgs = nullptr ) const |
Retrieve the partially-substitued template parameter pack.
If there is no partially-substituted parameter pack, returns NULL.
Definition at line 4784 of file SemaTemplateInstantiate.cpp.
References LocalInstantiationScope().
Referenced by ConvertDeducedTemplateArguments().
|
inline |
Definition at line 449 of file Template.h.
Definition at line 4720 of file SemaTemplateInstantiate.cpp.
References clang::cast(), getCanonicalParmVarDecl(), and LocalInstantiationScope().
Definition at line 4741 of file SemaTemplateInstantiate.cpp.
References clang::cast(), and getCanonicalParmVarDecl().
|
inline |
Determine whether this scope is for instantiating a lambda or block.
Definition at line 571 of file Template.h.
Determine whether D is a pack expansion created in this scope.
Definition at line 4764 of file SemaTemplateInstantiate.cpp.
void LocalInstantiationScope::MakeInstantiatedLocalArgPack | ( | const Decl * | D | ) |
Definition at line 4748 of file SemaTemplateInstantiate.cpp.
References getCanonicalParmVarDecl(), and LocalInstantiationScope().
|
delete |
References LocalInstantiationScope().
|
inline |
Reset the partially-substituted pack when it is no longer of interest.
Definition at line 553 of file Template.h.
Referenced by ConvertDeducedTemplateArguments().
void LocalInstantiationScope::SetPartiallySubstitutedPack | ( | NamedDecl * | Pack, |
const TemplateArgument * | ExplicitArgs, | ||
unsigned | NumExplicitArgs ) |
Note that the given parameter pack has been partially substituted via explicit specification of template arguments (C++0x [temp.arg.explicit]p9).
Pack | The parameter pack, which will always be a template parameter pack. |
ExplicitArgs | The explicitly-specified template arguments provided for this parameter pack. |
NumExplicitArgs | The number of explicitly-specified template arguments provided for this parameter pack. |
Definition at line 4771 of file SemaTemplateInstantiate.cpp.