summaryrefslogtreecommitdiff
path: root/lib/Index
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2018-10-04 11:03:55 +0000
committerHaojian Wu <hokein@google.com>2018-10-04 11:03:55 +0000
commit53a522e1306aff01960a0249ffe8bbd704e7abbe (patch)
tree7b9acbfd203418113340a923bf7242b8f399678e /lib/Index
parentfedf7909ee64d739dde5639e9e01598acdb83d8c (diff)
downloadclang-53a522e1306aff01960a0249ffe8bbd704e7abbe.tar.gz
[Index] Respect "IndexFunctionLocals" option for type loc.
Summary: Previously, clang index ignored local symbols defined in the function body even IndexFunctionLocals is true. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, ioeric, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D52877 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@343767 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Index')
-rw-r--r--lib/Index/IndexTypeSourceInfo.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Index/IndexTypeSourceInfo.cpp b/lib/Index/IndexTypeSourceInfo.cpp
index 8342e93c15..85afc63450 100644
--- a/lib/Index/IndexTypeSourceInfo.cpp
+++ b/lib/Index/IndexTypeSourceInfo.cpp
@@ -100,7 +100,8 @@ public:
bool VisitTagTypeLoc(TagTypeLoc TL) {
TagDecl *D = TL.getDecl();
- if (D->getParentFunctionOrMethod())
+ if (!IndexCtx.shouldIndexFunctionLocalSymbols() &&
+ D->getParentFunctionOrMethod())
return true;
if (TL.isDefinition()) {