[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-23 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL292805: [Sema] UsingShadowDecl shouldn't be hidden by the UsingDecl that owns it (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D28514?vs=85398=85414#toc Repository: rL

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-23 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. This revision is now accepted and ready to land. Thanks LGTM. Repository: rL LLVM https://reviews.llvm.org/D28514 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-23 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D28514#651724, @ahatanak wrote: > If they are equal, the loop can continue because a UsingDecl doesn't hide a > UsingShadowDecl that is tied to it. You're right, that would be better, I didn't notice that method before. Repository: rL

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-23 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 85398. arphaman added a comment. Verify that the using shadow decl can be hidden by its owning using decl. Repository: rL LLVM https://reviews.llvm.org/D28514 Files: lib/Sema/SemaLookup.cpp test/Index/complete-cached-globals.cpp Index:

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. If they are equal, the loop can continue because a UsingDecl doesn't hide a UsingShadowDecl that is tied to it. Repository: rL LLVM https://reviews.llvm.org/D28514 ___ cfe-commits mailing list

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In the example I showed, wouldn't the DeclContext for all the UsingDecls and UsingShadowDecls be the FunctionDecl for foo1? Maybe you can check whether UsingShadowDecl::getUsingDecl() (which returns the UsingDecl which is tied to the UsingShadowDecl) is equal to the

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 85151. arphaman added a comment. Ensure that the UsingShadowDecl and UsingDecl are in the same DeclContext. Repository: rL LLVM https://reviews.llvm.org/D28514 Files: lib/Sema/SemaLookup.cpp test/Index/complete-cached-globals.cpp Index:

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D28514#651675, @ahatanak wrote: > This is not invalid: > > namespace Foo { > class C { }; > } > namespace Bar { class C { }; } > > void foo1() { > using Foo::C; > { > using Bar::C; > } > } > I see, that could

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. This is not invalid: namespace Foo { class C { }; } namespace Bar { class C { }; } void foo1() { using Foo::C; { using Bar::C; } } Repository: rL LLVM https://reviews.llvm.org/D28514 ___

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I had something like the following code in mind (which is not invalid). Does usingdecl Bar::C hide Foo::C ? namespace Foo { class C { }; } namespace Bar { class C { }; } using Foo::C; { using Bar::C; } Repository: rL LLVM

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Sema/SemaLookup.cpp:3433 + // is not hidden by the using declaration. + if (isa(ND) && isa(D)) +continue; ahatanak wrote: > Do we have to check that ND's UsingDecl is equal to D? Or we don't have

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-19 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Looks good to me, but one more comment/question. Comment at: lib/Sema/SemaLookup.cpp:3433 + // is not hidden by the using declaration. + if (isa(ND) && isa(D)) +continue; Do we have to check that ND's UsingDecl is

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-18 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added inline comments. Comment at: lib/Sema/SemaCodeComplete.cpp:961 +// then incorrectly applied to the target declaration. This can be avoided +// by resetting the declaration that's being hidden. +if (Hiding && isa(Hiding)) ahatanak

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-18 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 84842. arphaman marked an inline comment as done. arphaman added a comment. Avoid the hidden declaration in `VisibleDeclsRecord::checkHidden` instead of the decl consumer in code-completion Repository: rL LLVM https://reviews.llvm.org/D28514 Files:

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-17 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added inline comments. Comment at: lib/Sema/SemaCodeComplete.cpp:961 +// then incorrectly applied to the target declaration. This can be avoided +// by resetting the declaration that's being hidden. +if (Hiding && isa(Hiding)) I'm not sure

[PATCH] D28514: [CodeCompletion] Reset the hidden declaration obtained after lookup when caching UsingShadowDecls

2017-01-10 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. arphaman added reviewers: manmanren, ahatanak, akyrtzi. arphaman added a subscriber: cfe-commits. arphaman set the repository for this revision to rL LLVM. This patch fixes an issue where cached global code completion results for a `using` declaration included the