mirror of
https://github.com/intel/llvm.git
synced 2026-02-09 01:52:26 +08:00
[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 llvm-svn: 343767
This commit is contained in:
@@ -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()) {
|
||||
|
||||
6
clang/test/Index/index-local-symbol.cpp
Normal file
6
clang/test/Index/index-local-symbol.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
void ff() {
|
||||
struct Foo {};
|
||||
}
|
||||
|
||||
// RUN: env CINDEXTEST_INDEXLOCALSYMBOLS=1 c-index-test -index-file %s | FileCheck %s
|
||||
// CHECK: [indexDeclaration]: kind: struct | name: Foo | {{.*}} | loc: 2:10
|
||||
Reference in New Issue
Block a user