[clangd] Refine the way of checking a declaration is referenced by the written code.
authorHaojian Wu <hokein@google.com>
Thu, 13 Dec 2018 13:17:04 +0000 (13:17 +0000)
committerHaojian Wu <hokein@google.com>
Thu, 13 Dec 2018 13:17:04 +0000 (13:17 +0000)
commitbf285337262a65c114922cf7fc17c1cdc0b31dd8
tree64d7e4a9e3d35ef3717e0b1cfaa195f16f7ba274
parente58e0903e20097230cd4186f46c16c05049ac8e8
[clangd] Refine the way of checking a declaration is referenced by the written code.

Summary:
The previous solution (checking the AST) is not a reliable way to
determine whether a declaration is explicitly referenced by the source
code, we are still missing a few cases.

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Differential Revision: https://reviews.llvm.org/D55191

llvm-svn: 349033
clang-tools-extra/clangd/XRefs.cpp
clang-tools-extra/unittests/clangd/XRefsTests.cpp