[PATCH] D52877: [Index] Respect "IndexFunctionLocals" option for type loc.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 4 04:05:44 PDT 2018


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()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52877.168263.patch
Type: text/x-patch
Size: 899 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20181004/48ad071a/attachment.bin>


More information about the cfe-commits mailing list