[clangd] Report only decl of overridding method in xref.
authorUtkarsh Saxena <usx@google.com>
Mon, 1 Feb 2021 20:17:53 +0000 (21:17 +0100)
committerUtkarsh Saxena <usx@google.com>
Tue, 2 Feb 2021 12:06:20 +0000 (13:06 +0100)
commitfbeff2ec2bc6e44b92931207b0063f83ff7a3b3a
tree44360372a59c7e4879d5e68c9a8441b314738b71
parent94f540cc7ceb98a25a62f04647ce30974a33a3d6
[clangd] Report only decl of overridding method in xref.

See: https://github.com/clangd/clangd/issues/668

```
struct A { virtual void foo() = 0; };
struct B : A { void foo() override; };
```

Find refs on `A::foo()` will show:
- decls of `A::foo()`
- decls of `B::foo()`
- refs to `A::foo()`
- no refs to `B::foo()`.

Differential Revision: https://reviews.llvm.org/D95812
clang-tools-extra/clangd/XRefs.cpp
clang-tools-extra/clangd/XRefs.h
clang-tools-extra/clangd/unittests/XRefsTests.cpp