15 #ifndef LLVM_CLANG_SEMA_IDENTIFIERRESOLVER_H
16 #define LLVM_CLANG_SEMA_IDENTIFIERRESOLVER_H
19 #include "llvm/ADT/SmallVector.h"
26 class DeclarationName;
27 class ExternalPreprocessorSource;
45 inline DeclsTy::iterator decls_begin() {
return Decls.begin(); }
46 inline DeclsTy::iterator decls_end() {
return Decls.end(); }
55 void InsertDecl(DeclsTy::iterator Pos,
NamedDecl *D) {
83 typedef IdDeclInfo::DeclsTy::iterator
BaseIter;
87 Ptr =
reinterpret_cast<uintptr_t
>(D);
88 assert((
Ptr & 0x1) == 0 &&
"Invalid Ptr!");
93 Ptr =
reinterpret_cast<uintptr_t
>(I) | 0x1;
99 assert(
isIterator() &&
"Ptr not an iterator!");
160 bool AllowInlineNamespace =
false)
const;
191 IdDeclInfoMap *IdDeclInfos;
197 static inline bool isDeclPtr(
void *Ptr) {
198 return (reinterpret_cast<uintptr_t>(Ptr) & 0x1) == 0;
202 static inline IdDeclInfo *toIdDeclInfo(
void *Ptr) {
203 assert((reinterpret_cast<uintptr_t>(Ptr) & 0x1) == 1
204 &&
"Ptr not a IdDeclInfo* !");
205 return reinterpret_cast<IdDeclInfo*
>(
206 reinterpret_cast<uintptr_t
>(Ptr) & ~0x1
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...
iterator begin(DeclarationName Name)
begin - Returns an iterator for decls with the name 'Name'.
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'.
bool operator!=(const iterator &RHS) const
void RemoveDecl(NamedDecl *D)
NamedDecl * operator*() const
uintptr_t getAsOpaqueValue() const
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
The result type of a method or function.
BaseIter getIterator() const
IdentifierResolver(Preprocessor &PP)
bool isDeclInScope(Decl *D, DeclContext *Ctx, Scope *S=nullptr, bool AllowInlineNamespace=false) const
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.
std::input_iterator_tag iterator_category
bool operator==(const iterator &RHS) const
__PTRDIFF_TYPE__ ptrdiff_t
static iterator getFromOpaqueValue(uintptr_t P)
IdDeclInfo::DeclsTy::iterator BaseIter
std::ptrdiff_t difference_type
Engages in a tight little dance with the lexer to efficiently preprocess tokens.