[cfe-dev] IdentifierResolver::IdDeclInfo and IdentifierResolver::iterator relations

Vladimir Voskresensky via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 15 22:54:11 PDT 2017


Dear Clang Developers,

clang::IdentifierResolver::iterator has a field 'Ptr' with a comment
     /// Ptr - There are 3 forms that 'Ptr' represents:
     /// 1) A single NamedDecl. (Ptr & 0x1 == 0)
     /// 2) A IdDeclInfo::DeclsTy::iterator that traverses only the 
decls of the
     ///    same declaration context. (Ptr & 0x3 == 0x1)
     /// 3) A IdDeclInfo::DeclsTy::iterator that traverses the decls of 
parent
     ///    declaration contexts too. (Ptr & 0x3 == 0x3)
     uintptr_t Ptr;

But I could not figure out where 3rd representation is used in Clang 
codebase.

clang::IdentifierResolver::toIdDeclInfo method unmask only the last bit.

So, where can I find the usage of (Ptr & 0x3 == 0x3)?

Thanks!
Vladimir.





More information about the cfe-dev mailing list