clang
7.0.0
|
IdentifierResolver - Keeps track of shadowed decls on enclosing scopes. More...
#include "clang/Sema/IdentifierResolver.h"
Classes | |
class | IdDeclInfoMap |
IdDeclInfoMap - Associates IdDeclInfos with declaration names. More... | |
class | iterator |
iterator - Iterate over the decls of a specified declaration name. More... | |
Public Member Functions | |
IdentifierResolver (Preprocessor &PP) | |
~IdentifierResolver () | |
iterator | begin (DeclarationName Name) |
begin - Returns an iterator for decls with the name 'Name'. More... | |
iterator | end () |
end - Returns an iterator that has 'finished'. More... | |
bool | isDeclInScope (Decl *D, DeclContext *Ctx, Scope *S=nullptr, bool AllowInlineNamespace=false) const |
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. More... | |
void | AddDecl (NamedDecl *D) |
AddDecl - Link the decl to its shadowed decl chain. More... | |
void | RemoveDecl (NamedDecl *D) |
RemoveDecl - Unlink the decl from its shadowed decl chain. More... | |
void | InsertDeclAfter (iterator Pos, NamedDecl *D) |
Insert the given declaration after the given iterator position. More... | |
bool | tryAddTopLevelDecl (NamedDecl *D, DeclarationName Name) |
Try to add the given declaration to the top level scope, if it (or a redeclaration of it) hasn't already been added. More... | |
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.
Definition at line 39 of file IdentifierResolver.h.
|
explicit |
Definition at line 90 of file IdentifierResolver.cpp.
Referenced by clang::IdentifierResolver::iterator::operator++().
IdentifierResolver::~IdentifierResolver | ( | ) |
Definition at line 93 of file IdentifierResolver.cpp.
Referenced by clang::IdentifierResolver::iterator::operator++().
void IdentifierResolver::AddDecl | ( | NamedDecl * | D | ) |
AddDecl - Link the decl to its shadowed decl chain.
Definition at line 145 of file IdentifierResolver.cpp.
IdentifierResolver::iterator IdentifierResolver::begin | ( | DeclarationName | Name | ) |
begin - Returns an iterator for decls with the name 'Name'.
begin - Returns an iterator for decls with name 'Name'.
Definition at line 231 of file IdentifierResolver.cpp.
Referenced by getDeclForLocalLookup(), clang::Sema::Initialize(), and clang::IdentifierResolver::iterator::operator++().
|
inline |
end - Returns an iterator that has 'finished'.
Definition at line 142 of file IdentifierResolver.h.
References isDeclInScope().
Referenced by getDeclForLocalLookup(), and clang::Sema::Initialize().
Insert the given declaration after the given iterator position.
Definition at line 170 of file IdentifierResolver.cpp.
bool IdentifierResolver::isDeclInScope | ( | Decl * | D, |
DeclContext * | Ctx, | ||
Scope * | S = nullptr , |
||
bool | AllowInlineNamespace = false |
||
) | const |
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.
AllowInlineNamespace | If 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. |
Definition at line 100 of file IdentifierResolver.cpp.
Referenced by end().
void IdentifierResolver::RemoveDecl | ( | NamedDecl * | D | ) |
RemoveDecl - Unlink the decl from its shadowed decl chain.
The decl must already be part of the decl chain.
Definition at line 210 of file IdentifierResolver.cpp.
bool IdentifierResolver::tryAddTopLevelDecl | ( | NamedDecl * | D, |
DeclarationName | Name | ||
) |
Try to add the given declaration to the top level scope, if it (or a redeclaration of it) hasn't already been added.
D | The externally-produced declaration to add. |
Name | The name of the externally-produced declaration. |
Definition at line 303 of file IdentifierResolver.cpp.