class IdentifierResolver

Declaration

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

Description

IdentifierResolver - Keeps track of shadowed decls on enclosing scopes. It manages the shadowing chains of declaration names and implements efficient decl lookup based on a declaration name.

Declared at: clang/include/clang/Sema/IdentifierResolver.h:38

Member Variables

private const clang::LangOptions& LangOpt
private clang::Preprocessor& PP
private clang::IdentifierResolver::IdDeclInfoMap* IdDeclInfos

Method Overview

  • public void AddDecl(clang::NamedDecl * D)
  • public IdentifierResolver(clang::Preprocessor & PP)
  • public void InsertDeclAfter(clang::IdentifierResolver::iterator Pos, clang::NamedDecl * D)
  • public void RemoveDecl(clang::NamedDecl * D)
  • public clang::IdentifierResolver::iterator begin(clang::DeclarationName Name)
  • public clang::IdentifierResolver::iterator end()
  • public bool isDeclInScope(clang::Decl * D, clang::DeclContext * Ctx, clang::Scope * S = nullptr, bool AllowInlineNamespace = false) const
  • private static inline bool isDeclPtr(void * Ptr)
  • private void readingIdentifier(clang::IdentifierInfo & II)
  • private static inline clang::IdentifierResolver::IdDeclInfo * toIdDeclInfo(void * Ptr)
  • public bool tryAddTopLevelDecl(clang::NamedDecl * D, clang::DeclarationName Name)
  • private void updatingIdentifier(clang::IdentifierInfo & II)
  • public ~IdentifierResolver()

Methods

void AddDecl(clang::NamedDecl* D)

Description

AddDecl - Link the decl to its shadowed decl chain.

Declared at: clang/include/clang/Sema/IdentifierResolver.h:159

Parameters

clang::NamedDecl* D

IdentifierResolver(clang::Preprocessor& PP)

Declared at: clang/include/clang/Sema/IdentifierResolver.h:134

Parameters

clang::Preprocessor& PP

void InsertDeclAfter(
    clang::IdentifierResolver::iterator Pos,
    clang::NamedDecl* D)

Description

Insert the given declaration after the given iterator position.

Declared at: clang/include/clang/Sema/IdentifierResolver.h:167

Parameters

clang::IdentifierResolver::iterator Pos
clang::NamedDecl* D

void RemoveDecl(clang::NamedDecl* D)

Description

RemoveDecl - Unlink the decl from its shadowed decl chain. The decl must already be part of the decl chain.

Declared at: clang/include/clang/Sema/IdentifierResolver.h:163

Parameters

clang::NamedDecl* D

clang::IdentifierResolver::iterator begin(
    clang::DeclarationName Name)

Description

begin - Returns an iterator for decls with the name 'Name'.

Declared at: clang/include/clang/Sema/IdentifierResolver.h:138

Parameters

clang::DeclarationName Name

clang::IdentifierResolver::iterator end()

Description

end - Returns an iterator that has 'finished'.

Declared at: clang/include/clang/Sema/IdentifierResolver.h:141

bool isDeclInScope(
    clang::Decl* D,
    clang::DeclContext* Ctx,
    clang::Scope* S = nullptr,
    bool AllowInlineNamespace = false) const

Description

isDeclInScope - If 'Ctx' is a function/method, isDeclInScope returns true if 'D' is in Scope 'S', otherwise 'S' is ignored and isDeclInScope returns true if 'D' belongs to the given declaration context.

Declared at: clang/include/clang/Sema/IdentifierResolver.h:155

Parameters

clang::Decl* D
clang::DeclContext* Ctx
clang::Scope* S = nullptr
bool AllowInlineNamespace = false
If \c true, we are checking whether a prior declaration is in scope in a declaration that requires a prior declaration (because it is either explicitly qualified or is a template instantiation or specialization). In this case, a declaration is in scope if it's in the inline namespace set of the context.

static inline bool isDeclPtr(void* Ptr)

Description

FETokenInfo contains a Decl pointer if lower bit == 0.

Declared at: clang/include/clang/Sema/IdentifierResolver.h:190

Parameters

void* Ptr

void readingIdentifier(clang::IdentifierInfo& II)

Declared at: clang/include/clang/Sema/IdentifierResolver.h:187

Parameters

clang::IdentifierInfo& II

static inline clang::IdentifierResolver::
    IdDeclInfo*
    toIdDeclInfo(void* Ptr)

Description

FETokenInfo contains a IdDeclInfo pointer if lower bit == 1.

Declared at: clang/include/clang/Sema/IdentifierResolver.h:195

Parameters

void* Ptr

bool tryAddTopLevelDecl(
    clang::NamedDecl* D,
    clang::DeclarationName Name)

Description

Try to add the given declaration to the top level scope, if it (or a redeclaration of it) hasn't already been added.

Declared at: clang/include/clang/Sema/IdentifierResolver.h:177

Parameters

clang::NamedDecl* D
The externally-produced declaration to add.
clang::DeclarationName Name
The name of the externally-produced declaration.

Returns

true if the declaration was added, false otherwise.

void updatingIdentifier(clang::IdentifierInfo& II)

Declared at: clang/include/clang/Sema/IdentifierResolver.h:186

Parameters

clang::IdentifierInfo& II

~IdentifierResolver()

Declared at: clang/include/clang/Sema/IdentifierResolver.h:135