[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG65f61c0030c5: [clangd] Report declaration references in findExplicitReferences. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D68977?vs=225597&id=225601#toc Repository: rG L

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-18 Thread pre-merge checks [bot] via Phabricator via cfe-commits
merge_guards_bot added a comment. Build result: fail - 33449 tests passed, 2 failed and 463 were skipped. failed: LLVM.tools/llvm-ar/mri-utf8.test failed: LLVM.tools/llvm-objdump/X86/disassemble-functions.test Log files: cmake-log.txt

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-18 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM. Many thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68977/new/ https://reviews.llvm.org/D68977 ___

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225597. hokein marked 2 inline comments as done. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68977/new/ https://reviews.llvm.org/D68977 Files: clang-tools-extra/cla

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-18 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:495 struct Visitor : TypeLocVisitor { -llvm::Optional Ref; +llvm::SmallVector Refs; Could we keep an `llvm::Optional<>` here in the visitor? The logic in `VisitE

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:2280 } -EXPECT_THAT(Names, UnorderedElementsAreArray(C.ExpectedDecls)); +EXPECT_THAT(Names, UnorderedElementsAreArray(C.ExpectedDecls)) +<< File.code(); --

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225428. hokein marked 7 inline comments as done. hokein added a comment. address remaining nits. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68977/new/ https://reviews.llvm.org/D68977 Files: clang-tools-ext

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:415 Optional refInDecl(const Decl *D) { struct Visitor : ConstDeclVisitor { ilya-biryukov wrote: > kadircet wrote: > > ilya-biryukov wrote: > > > hokein wrote: > > > > ilya-

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Mostly NITs from my side, the change LG, thanks! Comment at: clang-tools-extra/clangd/FindTarget.cpp:422 + // "using namespace" declaration doesn't have a name. + Refs.push_back({D->getQualifierLoc(), + D->getIdentLo

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225420. hokein marked 6 inline comments as done. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68977/new/ https://reviews.llvm.org/D68977 Files: clang-tools-extra/cla

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/unittests/FindTargetTests.cpp:850 + "1: targets = {Foo::Foo}, decl\n" + "2: targets = {Foo::~Foo}, decl\n" + "3: targets = {Foo}\n" ilya-biryukov wrote: > Could we av

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:415 Optional refInDecl(const Decl *D) { struct Visitor : ConstDeclVisitor { kadircet wrote: > ilya-biryukov wrote: > > hokein wrote: > > > ilya-biryukov wrote: > > > >

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:438 D->getTargetNameLoc(), + /*IsDecl=*/true, {D->getAliasedNamespace()}}; This one is a **not** a

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/unittests/FindTargetTests.cpp:846 + // the underlying FunctionDecl. we should report just one. + void $12^$13^F() {} + )cpp", Could we avoid adding this te

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:110 + +static bool isAnonymous(const DeclarationName &N) { + return N.isIdentifier() && !N.getAsIdentifierInfo(); could you move this one back above `getQualifierLoc` ? ==

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/unittests/FindTargetTests.cpp:528 + /// AST. + AllRefs annotateReferencesInMainAST(llvm::StringRef Code) { +TestTU TU; hokein wrote: > ilya-biryukov wrote: > > Why do we need this? Ca

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:415 Optional refInDecl(const Decl *D) { struct Visitor : ConstDeclVisitor { hokein wrote: > ilya-biryukov wrote: > > This should return `SmallVector` now, some declarat

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 225398. hokein marked 14 inline comments as done. hokein added a comment. address comments: - remove the confusing IsDeclRef - use getQualifier from AST.h Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68977/new/

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:415 Optional refInDecl(const Decl *D) { struct Visitor : ConstDeclVisitor { ilya-biryukov wrote: > This should return `SmallVector` now, some declarations can > have both dec

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-16 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Mostly LG, but please take a look at the NITs and the implementation-related comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:415 Optional refInDecl(const Decl *D) { struct Visitor : ConstDeclVisitor { This sho

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-15 Thread pre-merge checks [bot] via Phabricator via cfe-commits
merge_guards_bot added a comment. Bulid results are available at http://results.llvm-merge-guard.org/Phabricator-36 See http://jenkins.llvm-merge-guard.org/job/Phabricator/36/ for more details. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68977

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-15 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D68977 Files: clang-tools-extra/clangd/FindTarget.cpp