15 #ifndef LLVM_CLANG_SEMA_IDENTIFIERRESOLVER_H 16 #define LLVM_CLANG_SEMA_IDENTIFIERRESOLVER_H 19 #include "llvm/ADT/SmallVector.h" 28 class DeclarationName;
48 DeclsTy::iterator decls_begin() {
return Decls.begin(); }
49 DeclsTy::iterator decls_end() {
return Decls.end(); }
58 void InsertDecl(DeclsTy::iterator Pos,
NamedDecl *D) {
85 using BaseIter = IdDeclInfo::DeclsTy::iterator;
90 assert((Ptr & 0x1) == 0 &&
"Invalid Ptr!");
96 Ptr =
reinterpret_cast<uintptr_t>(I) | 0x1;
102 assert(
isIterator() &&
"Ptr not an iterator!");
103 return reinterpret_cast<BaseIter>(Ptr & ~0x1);
106 void incrementSlowCase();
113 return *getIterator();
115 return reinterpret_cast<NamedDecl*
>(Ptr);
119 return Ptr == RHS.
Ptr;
122 return Ptr != RHS.
Ptr;
157 bool AllowInlineNamespace =
false)
const;
191 static inline bool isDeclPtr(
void *Ptr) {
192 return (reinterpret_cast<uintptr_t>(Ptr) & 0x1) == 0;
196 static inline IdDeclInfo *toIdDeclInfo(
void *Ptr) {
197 assert((reinterpret_cast<uintptr_t>(Ptr) & 0x1) == 1
198 &&
"Ptr not a IdDeclInfo* !");
199 return reinterpret_cast<IdDeclInfo*
>(
200 reinterpret_cast<uintptr_t>(Ptr) & ~0x1);
206 #endif // LLVM_CLANG_SEMA_IDENTIFIERRESOLVER_H iterator(NamedDecl *D)
A single NamedDecl. (Ptr & 0x1 == 0)
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 alre...
BaseIter getIterator() const
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'...
Decl - This represents one declaration (or definition), e.g.
std::ptrdiff_t difference_type
The l-value was an access to a declared entity or something equivalently strong, like the address of ...
iterator begin(DeclarationName Name)
begin - Returns an iterator for decls with the name 'Name'.
NamedDecl * operator*() const
One of these records is kept for each identifier that is lexed.
bool operator!=(const iterator &RHS) const
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
iterator end()
end - Returns an iterator that has 'finished'.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
void RemoveDecl(NamedDecl *D)
RemoveDecl - Unlink the decl from its shadowed decl chain.
Scope - A scope is a transient data structure that is used while parsing the program.
IdDeclInfoMap - Associates IdDeclInfos with declaration names.
IdDeclInfo::DeclsTy::iterator BaseIter
std::input_iterator_tag iterator_category
IdentifierResolver - Keeps track of shadowed decls on enclosing scopes.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
Dataflow Directional Tag Classes.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
IdentifierResolver(Preprocessor &PP)
bool operator==(const iterator &RHS) const
The name of a declaration.
void InsertDeclAfter(iterator Pos, NamedDecl *D)
Insert the given declaration after the given iterator position.
void AddDecl(NamedDecl *D)
AddDecl - Link the decl to its shadowed decl chain.
iterator(BaseIter I)
A IdDeclInfo::DeclsTy::iterator that walks or not the parent declaration contexts depending on 'LookI...
uintptr_t Ptr
Ptr - There are 2 forms that 'Ptr' represents: 1) A single NamedDecl.
This represents a decl that may have a name.
bool isIterator(const CXXRecordDecl *CRD)
iterator - Iterate over the decls of a specified declaration name.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.