summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/XRefs.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2019-10-18 12:07:19 +0000
committerHaojian Wu <hokein@google.com>2019-10-18 12:07:19 +0000
commit65f61c0030c5c375852f27ff6dd21e6a078e2420 (patch)
treeb5920b9a04aed94eb16f0b38367ec3e53721303f /clang-tools-extra/clangd/XRefs.cpp
parentbc887a8d4a379625f9abf3d53cfa56fb1d26e78d (diff)
downloadbcm5719-llvm-65f61c0030c5c375852f27ff6dd21e6a078e2420.tar.gz
bcm5719-llvm-65f61c0030c5c375852f27ff6dd21e6a078e2420.zip
[clangd] Report declaration references in findExplicitReferences.
Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68977 llvm-svn: 375226
Diffstat (limited to 'clang-tools-extra/clangd/XRefs.cpp')
-rw-r--r--clang-tools-extra/clangd/XRefs.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp
index 43904cddbaa..2e75e8c8005 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -1308,7 +1308,8 @@ llvm::DenseSet<const Decl *> getNonLocalDeclRefs(ParsedAST &AST,
llvm::DenseSet<const Decl *> DeclRefs;
findExplicitReferences(FD, [&](ReferenceLoc Ref) {
for (const Decl *D : Ref.Targets) {
- if (!index::isFunctionLocalSymbol(D) && !D->isTemplateParameter())
+ if (!index::isFunctionLocalSymbol(D) && !D->isTemplateParameter() &&
+ !Ref.IsDecl)
DeclRefs.insert(D);
}
});
OpenPOWER on IntegriCloud