clang 8.0.0

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

## Public Member Functions
| LocalInstantiationScope (Sema &SemaRef, bool CombineWithOuterScope=false)
| LocalInstantiationScope (const LocalInstantiationScope &)=delete
LocalInstantiationScope & | operator= (const LocalInstantiationScope &)=delete
| ~LocalInstantiationScope ()
const Sema & | getSema () const
void | Exit ()
| Exit this local instantiation scope early. More...
LocalInstantiationScope * | cloneScopes (LocalInstantiationScope *Outermost)
| Clone this scope, and all outer scopes, down to the given outermost scope. More...
llvm::PointerUnion< Decl *, DeclArgumentPack * > * | findInstantiationOf (const Decl *D)
| Find the instantiation of the declaration D within the current instantiation scope. More...
void | InstantiatedLocal (const Decl *D, Decl *Inst)
void | InstantiatedLocalPackArg (const Decl *D, ParmVarDecl *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). More...
void | ResetPartiallySubstitutedPack ()
| Reset the partially-substituted pack when it is no longer of interest. More...
NamedDecl * | getPartiallySubstitutedPack (const TemplateArgument **ExplicitArgs=nullptr, unsigned *NumExplicitArgs=nullptr) const
| Retrieve the partially-substitued template parameter pack. More...

## Static Public Member Functions
static void | deleteScopes (LocalInstantiationScope *Scope, LocalInstantiationScope *Outermost)
| deletes the given scope, and all otuer scopes, down to the given outermost scope. More...

## 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 228 of file Template.h.

## Member Typedef Documentation

## ◆ DeclArgumentPack

using clang::LocalInstantiationScope::DeclArgumentPack = SmallVector<ParmVarDecl *, 4>

A set of declarations.

Definition at line 231 of file Template.h.

## Constructor & Destructor Documentation

## ◆ LocalInstantiationScope() [1/2]

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

Definition at line 291 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 301 of file Template.h.

## 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 321 of file Template.h.

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

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

## ◆ deleteScopes()

static void clang::LocalInstantiationScope::deleteScopes | ( | LocalInstantiationScope * | Scope,
|  | LocalInstantiationScope * | Outermost
| ) |  |
| inline static

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

Definition at line 361 of file Template.h.

References findInstantiationOf().

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

## ◆ Exit()

void clang::LocalInstantiationScope::Exit | ( |  | ) |
| inline

Exit this local instantiation scope early.

Definition at line 308 of file Template.h.

References clang::Sema::CurrentInstantiationScope.

## ◆ findInstantiationOf()

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

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

Parameters

  D | The 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 2899 of file SemaTemplateInstantiate.cpp.

References getCanonicalParmVarDecl().

## ◆ 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 3004 of file SemaTemplateInstantiate.cpp.

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

## ◆ getSema()

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

Definition at line 305 of file Template.h.

## ◆ InstantiatedLocal()

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

Definition at line 2947 of file SemaTemplateInstantiate.cpp.

References getCanonicalParmVarDecl().

Referenced by clang::TemplateDeclInstantiator::InstantiateEnumDefinition(), clang::TemplateDeclInstantiator::InstantiateTypedefNameDecl(), clang::TemplateDeclInstantiator::SubstFunctionType(), clang::Sema::SubstParmVarDecl(), clang::TemplateDeclInstantiator::VisitCXXMethodDecl(), and clang::TemplateDeclInstantiator::VisitVarDecl().

## ◆ InstantiatedLocalPackArg()

void LocalInstantiationScope::InstantiatedLocalPackArg | ( | const Decl * | D,
|  | ParmVarDecl * | Inst
| ) |  |

Definition at line 2968 of file SemaTemplateInstantiate.cpp.

References getCanonicalParmVarDecl().

Referenced by clang::TemplateDeclInstantiator::SubstFunctionType(), and clang::Sema::SubstParmVarDecl().

## ◆ MakeInstantiatedLocalArgPack()

void LocalInstantiationScope::MakeInstantiatedLocalArgPack | ( | const Decl * | D | ) |

Definition at line 2975 of file SemaTemplateInstantiate.cpp.

Referenced by clang::Sema::isSFINAEContext(), and clang::TemplateDeclInstantiator::SubstFunctionType().

## ◆ 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 403 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

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

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

- include/clang/Sema/Template.h
- lib/Sema/SemaTemplateInstantiate.cpp