summaryrefslogtreecommitdiffstats
path: root/clang/lib/Index/IndexBody.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2018-12-19 13:44:41 +0000
committerHaojian Wu <hokein@google.com>2018-12-19 13:44:41 +0000
commite2a27b3f76f4249df786aa5b5fa0006a7f8c05a4 (patch)
treeb769d9ec2d95e9ef81ea41877843a3e5d7310fd8 /clang/lib/Index/IndexBody.cpp
parent6c95bea072a8999818c26da9fec9332cdf6d9bee (diff)
downloadbcm5719-llvm-e2a27b3f76f4249df786aa5b5fa0006a7f8c05a4.tar.gz
bcm5719-llvm-e2a27b3f76f4249df786aa5b5fa0006a7f8c05a4.zip
[Index] Index paremeters in lambda expressions.
Summary: This fixes clangd couldn't find references for lambda parameters. Reviewers: ilya-biryukov Subscribers: ioeric, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55437 llvm-svn: 349626
Diffstat (limited to 'clang/lib/Index/IndexBody.cpp')
-rw-r--r--clang/lib/Index/IndexBody.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Index/IndexBody.cpp b/clang/lib/Index/IndexBody.cpp
index dd8a1c7b3f7..54a6df2496a 100644
--- a/clang/lib/Index/IndexBody.cpp
+++ b/clang/lib/Index/IndexBody.cpp
@@ -9,6 +9,7 @@
#include "IndexingContext.h"
#include "clang/AST/RecursiveASTVisitor.h"
+#include "clang/AST/ASTLambda.h"
using namespace clang;
using namespace clang::index;
@@ -454,6 +455,16 @@ public:
}
return true;
}
+
+ bool VisitParmVarDecl(ParmVarDecl* D) {
+ // Index the parameters of lambda expression.
+ if (IndexCtx.shouldIndexFunctionLocalSymbols()) {
+ const auto *DC = D->getDeclContext();
+ if (DC && isLambdaCallOperator(DC))
+ IndexCtx.handleDecl(D);
+ }
+ return true;
+ }
};
} // anonymous namespace
OpenPOWER on IntegriCloud