This revision was automatically updated to reflect the committed changes. Closed by commit rC343767: [Index] Respect "IndexFunctionLocals" option for type loc. (authored by hokein, committed by ).
Changed prior to commit: https://reviews.llvm.org/D52877?vs=168261&id=168263#toc Repository: rC Clang https://reviews.llvm.org/D52877 Files: lib/Index/IndexTypeSourceInfo.cpp test/Index/index-local-symbol.cpp Index: test/Index/index-local-symbol.cpp =================================================================== --- test/Index/index-local-symbol.cpp +++ test/Index/index-local-symbol.cpp @@ -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 \ No newline at end of file Index: lib/Index/IndexTypeSourceInfo.cpp =================================================================== --- lib/Index/IndexTypeSourceInfo.cpp +++ lib/Index/IndexTypeSourceInfo.cpp @@ -100,7 +100,8 @@ bool VisitTagTypeLoc(TagTypeLoc TL) { TagDecl *D = TL.getDecl(); - if (D->getParentFunctionOrMethod()) + if (!IndexCtx.shouldIndexFunctionLocalSymbols() && + D->getParentFunctionOrMethod()) return true; if (TL.isDefinition()) {
Index: test/Index/index-local-symbol.cpp =================================================================== --- test/Index/index-local-symbol.cpp +++ test/Index/index-local-symbol.cpp @@ -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 \ No newline at end of file Index: lib/Index/IndexTypeSourceInfo.cpp =================================================================== --- lib/Index/IndexTypeSourceInfo.cpp +++ lib/Index/IndexTypeSourceInfo.cpp @@ -100,7 +100,8 @@ bool VisitTagTypeLoc(TagTypeLoc TL) { TagDecl *D = TL.getDecl(); - if (D->getParentFunctionOrMethod()) + if (!IndexCtx.shouldIndexFunctionLocalSymbols() && + D->getParentFunctionOrMethod()) return true; if (TL.isDefinition()) {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits