Quantcast

IdentifierResolver::IdDeclInfo and IdentifierResolver::iterator relations

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

IdentifierResolver::IdDeclInfo and IdentifierResolver::iterator relations

Ivan Garramona via cfe-dev
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.


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: IdentifierResolver::IdDeclInfo and IdentifierResolver::iterator relations

Ivan Garramona via cfe-dev
Could some one advise, please.

Thanks!
Vladimir.

On 16.03.2017 08:54, Vladimir Voskresensky via cfe-dev 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)?
>
> Thanks!
> Vladimir.
>
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: IdentifierResolver::IdDeclInfo and IdentifierResolver::iterator relations

Ivan Garramona via cfe-dev
In reply to this post by Ivan Garramona via cfe-dev
On Thu, Mar 16, 2017 at 1:54 AM, Vladimir Voskresensky via cfe-dev
<[hidden email]> 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
> [hidden email]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Loading...