clang 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
clang::LocalInstantiationScope Class Reference

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< VarDecl *, 4 >
 A set of declarations.
 

Public Member Functions

 LocalInstantiationScope (Sema &SemaRef, bool CombineWithOuterScope=false)
 
 LocalInstantiationScope (const LocalInstantiationScope &)=delete
 
LocalInstantiationScopeoperator= (const LocalInstantiationScope &)=delete
 
 ~LocalInstantiationScope ()
 
const SemagetSema () const
 
void Exit ()
 Exit this local instantiation scope early.
 
LocalInstantiationScopecloneScopes (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.
 
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.
 
NamedDeclgetPartiallySubstitutedPack (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.
 

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.
 

Detailed Description

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.

Member Typedef Documentation

◆ DeclArgumentPack

A set of declarations.

Definition at line 368 of file Template.h.

Constructor & Destructor Documentation

◆ LocalInstantiationScope() [1/2]

clang::LocalInstantiationScope::LocalInstantiationScope ( Sema SemaRef,
bool  CombineWithOuterScope = false 
)
inline

Definition at line 428 of file Template.h.

References clang::Sema::CurrentInstantiationScope.

◆ LocalInstantiationScope() [2/2]

clang::LocalInstantiationScope::LocalInstantiationScope ( const LocalInstantiationScope )
delete

◆ ~LocalInstantiationScope()

clang::LocalInstantiationScope::~LocalInstantiationScope ( )
inline

Definition at line 438 of file Template.h.

References Exit().

Member Function Documentation

◆ cloneScopes()

LocalInstantiationScope * clang::LocalInstantiationScope::cloneScopes ( LocalInstantiationScope Outermost)
inline

Clone this scope, and all outer scopes, down to the given outermost scope.

Definition at line 458 of file Template.h.

References cloneScopes(), clang::Sema::CurrentInstantiationScope, D, and E.

Referenced by cloneScopes(), and clang::Sema::InstantiateAttrs().

◆ deleteScopes()

static void clang::LocalInstantiationScope::deleteScopes ( LocalInstantiationScope Scope,
LocalInstantiationScope Outermost 
)
inlinestatic

deletes the given scope, and all outer scopes, down to the given outermost scope.

Definition at line 498 of file Template.h.

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

◆ Exit()

void clang::LocalInstantiationScope::Exit ( )
inline

Exit this local instantiation scope early.

Definition at line 445 of file Template.h.

References clang::Sema::CurrentInstantiationScope.

Referenced by ~LocalInstantiationScope().

◆ findInstantiationOf()

llvm::PointerUnion< Decl *, LocalInstantiationScope::DeclArgumentPack * > * LocalInstantiationScope::findInstantiationOf ( const Decl D)

Find the instantiation of the declaration D within the current instantiation scope.

Parameters
DThe declaration whose instantiation we are searching for.
Returns
A pointer to the declaration or argument pack of declarations to which the declaration D is instantiated, if found. Otherwise, returns NULL.

Definition at line 4350 of file SemaTemplateInstantiate.cpp.

References D, clang::Found, getCanonicalParmVarDecl(), and clang::Decl::getDeclContext().

Referenced by clang::Sema::CheckParameterPacksForExpansion(), clang::Sema::FindInstantiatedDecl(), and clang::Sema::getNumArgumentsInExpansionFromUnexpanded().

◆ getPartiallySubstitutedPack()

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 4468 of file SemaTemplateInstantiate.cpp.

Referenced by clang::Sema::CheckParameterPacksForExpansion(), and clang::Sema::CheckTemplateArgumentList().

◆ getSema()

const Sema & clang::LocalInstantiationScope::getSema ( ) const
inline

Definition at line 442 of file Template.h.

◆ InstantiatedLocal()

void LocalInstantiationScope::InstantiatedLocal ( const Decl D,
Decl Inst 
)

◆ InstantiatedLocalPackArg()

void LocalInstantiationScope::InstantiatedLocalPackArg ( const Decl D,
VarDecl Inst 
)

Definition at line 4425 of file SemaTemplateInstantiate.cpp.

References D, and getCanonicalParmVarDecl().

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

◆ isLocalPackExpansion()

bool LocalInstantiationScope::isLocalPackExpansion ( const Decl D)

Determine whether D is a pack expansion created in this scope.

Definition at line 4448 of file SemaTemplateInstantiate.cpp.

References D.

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

◆ MakeInstantiatedLocalArgPack()

void LocalInstantiationScope::MakeInstantiatedLocalArgPack ( const Decl D)

Definition at line 4432 of file SemaTemplateInstantiate.cpp.

References D, and getCanonicalParmVarDecl().

◆ operator=()

LocalInstantiationScope & clang::LocalInstantiationScope::operator= ( const LocalInstantiationScope )
delete

◆ ResetPartiallySubstitutedPack()

void clang::LocalInstantiationScope::ResetPartiallySubstitutedPack ( )
inline

Reset the partially-substituted pack when it is no longer of interest.

Definition at line 540 of file Template.h.

◆ SetPartiallySubstitutedPack()

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).

Parameters
PackThe parameter pack, which will always be a template parameter pack.
ExplicitArgsThe explicitly-specified template arguments provided for this parameter pack.
NumExplicitArgsThe number of explicitly-specified template arguments provided for this parameter pack.

Definition at line 4455 of file SemaTemplateInstantiate.cpp.

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


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