class LocalInstantiationScope

Declaration

class LocalInstantiationScope { /* full declaration omitted */ };

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.

Declared at: clang/include/clang/Sema/Template.h:304

Member Variables

private clang::Sema& SemaRef
Reference to the semantic analysis that is performing this template instantiation.
private clang::LocalInstantiationScope::LocalDeclsMap LocalDecls
For a parameter pack, the local instantiation scope may contain a set of instantiated parameters. This is stored as a DeclArgumentPack pointer.
private SmallVector<clang::LocalInstantiationScope:: DeclArgumentPack*, 1> ArgumentPacks
The set of argument packs we've allocated.
private clang::LocalInstantiationScope* Outer
The outer scope, which contains local variable definitions from some other instantiation (that may not be relevant to this particular scope).
private bool Exited = false
Whether we have already exited this scope.
private bool CombineWithOuterScope
Whether to combine this scope with the outer scope, such that lookup will search our outer scope.
private clang::NamedDecl* PartiallySubstitutedPack = nullptr
If non-NULL, the template parameter pack that has been partially substituted per C++0x [temp.arg.explicit]p9.
private const clang::TemplateArgument* ArgsInPartiallySubstitutedPack
If \c PartiallySubstitutedPack is non-null, the set of explicitly-specified template arguments in that pack.
private unsigned int NumArgsInPartiallySubstitutedPack
If \c PartiallySubstitutedPack, the number of explicitly-specified template arguments in ArgsInPartiallySubstitutedPack.

Method Overview

Methods

void Exit()

Description

Exit this local instantiation scope early.

Declared at: clang/include/clang/Sema/Template.h:384

void InstantiatedLocal(const clang::Decl* D,
                       clang::Decl* Inst)

Declared at: clang/include/clang/Sema/Template.h:457

Parameters

const clang::Decl* D
clang::Decl* Inst

void InstantiatedLocalPackArg(
    const clang::Decl* D,
    clang::VarDecl* Inst)

Declared at: clang/include/clang/Sema/Template.h:458

Parameters

const clang::Decl* D
clang::VarDecl* Inst

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

Declared at: clang/include/clang/Sema/Template.h:367

Parameters

clang::Sema& SemaRef
bool CombineWithOuterScope = false

LocalInstantiationScope(
    const clang::LocalInstantiationScope&)

Declared at: clang/include/clang/Sema/Template.h:373

Parameters

const clang::LocalInstantiationScope&

void MakeInstantiatedLocalArgPack(
    const clang::Decl* D)

Declared at: clang/include/clang/Sema/Template.h:459

Parameters

const clang::Decl* D

void ResetPartiallySubstitutedPack()

Description

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

Declared at: clang/include/clang/Sema/Template.h:479

void SetPartiallySubstitutedPack(
    clang::NamedDecl* Pack,
    const clang::TemplateArgument* ExplicitArgs,
    unsigned int NumExplicitArgs)

Description

Note that the given parameter pack has been partially substituted via explicit specification of template arguments (C++0x [temp.arg.explicit]p9).

Declared at: clang/include/clang/Sema/Template.h:473

Parameters

clang::NamedDecl* Pack
The parameter pack, which will always be a template parameter pack.
const clang::TemplateArgument* ExplicitArgs
The explicitly-specified template arguments provided for this parameter pack.
unsigned int NumExplicitArgs
The number of explicitly-specified template arguments provided for this parameter pack.

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

Description

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

Declared at: clang/include/clang/Sema/Template.h:397

Parameters

clang::LocalInstantiationScope* Outermost

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

Description

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

Declared at: clang/include/clang/Sema/Template.h:437

Parameters

clang::LocalInstantiationScope* Scope
clang::LocalInstantiationScope* Outermost

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

Description

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

Declared at: clang/include/clang/Sema/Template.h:455

Parameters

const clang::Decl* D
The declaration whose instantiation we are searching for.

Returns

A pointer to the declaration or argument pack of declarations to which the declaration \c D is instantiated, if found. Otherwise, returns NULL.

clang::NamedDecl* getPartiallySubstitutedPack(
    const clang::TemplateArgument** ExplicitArgs =
        nullptr,
    unsigned int* NumExplicitArgs = nullptr) const

Description

Retrieve the partially-substitued template parameter pack. If there is no partially-substituted parameter pack, returns NULL.

Declared at: clang/include/clang/Sema/Template.h:490

Parameters

const clang::TemplateArgument** ExplicitArgs = nullptr
unsigned int* NumExplicitArgs = nullptr

const clang::Sema& getSema() const

Declared at: clang/include/clang/Sema/Template.h:381

bool isLocalPackExpansion(const clang::Decl* D)

Description

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

Declared at: clang/include/clang/Sema/Template.h:494

Parameters

const clang::Decl* D

~LocalInstantiationScope()

Declared at: clang/include/clang/Sema/Template.h:377