[PATCH] D110825: [clangd] Handle members of anon structs in SelectionTree

2021-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG512aa8485010: [clangd] Handle members of anon structs in SelectionTree (authored by kadircet). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110825/new/ htt

[PATCH] D110825: [clangd] Handle members of anon structs in SelectionTree

2021-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 376445. kadircet marked 2 inline comments as done. kadircet added a comment. - update comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110825/new/ https://reviews.llvm.org/D110825 Files: clang-tools-e

[PATCH] D110825: [clangd] Handle members of anon structs in SelectionTree

2021-09-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. Thanks! Comment at: clang-tools-extra/clangd/Selection.cpp:446 return true; + // Make sure anonymous structs don't end up owning tokens. + if (auto *ME = llvm:

[PATCH] D110825: [clangd] Handle members of anon structs in SelectionTree

2021-09-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/Selection.cpp:443 // It would be nice if RAV handled this (!shouldTraverseImplicitCode()). if (auto *CTI = llvm::dyn_cast(S)) if (CTI->isImplicit()) sammccall wrote: > kadircet wrote:

[PATCH] D110825: [clangd] Handle members of anon structs in SelectionTree

2021-09-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 376238. kadircet marked 4 inline comments as done. kadircet added a comment. - Use `isImplicit` rather than `earlyClaim` Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110825/new/ https://reviews.llvm.org/D1108

[PATCH] D110825: [clangd] Handle members of anon structs in SelectionTree

2021-09-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:368 +TEST(LocateSymbol, AnonymousStructFields) { + auto Code = Annotations(R"cpp( kadircet wrote: > sammccall wrote: > > This example is quite complicated to the poi

[PATCH] D110825: [clangd] Handle members of anon structs in SelectionTree

2021-09-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/clangd/Selection.cpp:443 // It would be nice if RAV handled this (!shouldTraverseImplicitCode()). if (auto *CTI = llvm::dyn_cast(S)) if (CTI->isImplicit()) kadircet wrote: > sammccall wrote

[PATCH] D110825: [clangd] Handle members of anon structs in SelectionTree

2021-09-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/Selection.cpp:443 // It would be nice if RAV handled this (!shouldTraverseImplicitCode()). if (auto *CTI = llvm::dyn_cast(S)) if (CTI->isImplicit()) sammccall wrote: > seems like it'd

[PATCH] D110825: [clangd] Handle members of anon structs in SelectionTree

2021-09-30 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Thanks for fixing! Early-claim is a blunt hammer and I'm always dreading side-effects. This also feels a *lot* like implicit-this which is handled in another way. So that seems worth a shot, but this approach is fine if that one doesn't work. Commen

[PATCH] D110825: [clangd] Handle members of anon structs in SelectionTree

2021-09-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/Selection.cpp:745 + if (auto *FD = llvm::dyn_cast(ME->getMemberDecl())) { +if (FD->getParent()->isAnonymousStructOrUnion()) + return SourceRange(ME->getMemberLoc(), ME->getEndLoc()); --

[PATCH] D110825: [clangd] Handle members of anon structs in SelectionTree

2021-09-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: sammccall. Herald added subscribers: usaxena95, arphaman. kadircet requested review of this revision. Herald added subscribers: cfe-commits, MaskRay, ilya-biryukov. Herald added a project: clang-tools-extra. References to fields inside ano