[clangd] Fix irrelevant declaratations in goto definition (on macros).
authorHaojian Wu <hokein@google.com>
Tue, 13 Mar 2018 12:30:59 +0000 (12:30 +0000)
committerHaojian Wu <hokein@google.com>
Tue, 13 Mar 2018 12:30:59 +0000 (12:30 +0000)
commit2658cb65bdc51f3569b9494c13024a9504ef7fb0
treef6c43ba3e3ae59e5074b4ceb22b3dfcaae998418
parent797f32e084071d225ecaf094460e8fc35d330d78
[clangd] Fix irrelevant declaratations in goto definition (on macros).

Summary:
DeclrationAndMacrosFinder will find some declarations (not macro!) that are
referened inside the macro somehow, isSearchedLocation() is not sufficient, we
don't know whether the searched source location is macro or not.

Reviewers: ilya-biryukov

Subscribers: klimek, jkorous-apple, ioeric, cfe-commits

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

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