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

Aaron Ballman via cfe-dev cfe-dev at lists.llvm.org
Sun Mar 19 08:27:51 PDT 2017


On Thu, Mar 16, 2017 at 1:54 AM, Vladimir Voskresensky via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
> 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)?

I believe this comment is now stale. The original commit used to have
a helper function called LookInParentCtx() that used this flag. I've
cleaned the comments and class up  somewhat in r298215.

Thanks!

~Aaron

>
> Thanks!
> Vladimir.
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list