[cfe-commits] r150647 - in /cfe/trunk: test/Index/index-refs.cpp tools/libclang/IndexTypeSourceInfo.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Wed Feb 15 17:12:04 PST 2012


Author: akirtzidis
Date: Wed Feb 15 19:12:04 2012
New Revision: 150647

URL: http://llvm.org/viewvc/llvm-project?rev=150647&view=rev
Log:
[libclang] Do index statements inside a type source info. rdar://10872758

Modified:
    cfe/trunk/test/Index/index-refs.cpp
    cfe/trunk/tools/libclang/IndexTypeSourceInfo.cpp

Modified: cfe/trunk/test/Index/index-refs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/index-refs.cpp?rev=150647&r1=150646&r2=150647&view=diff
==============================================================================
--- cfe/trunk/test/Index/index-refs.cpp (original)
+++ cfe/trunk/test/Index/index-refs.cpp Wed Feb 15 19:12:04 2012
@@ -55,6 +55,12 @@
   TS<int, int> s;
 }
 
+const int array_size = 3;
+typedef int some_arr[array_size];
+
+const int default_param = 3;
+void foo4(int p = default_param);
+
 // RUN: c-index-test -index-file %s | FileCheck %s
 // CHECK:      [indexDeclaration]: kind: namespace | name: NS
 // CHECK-NEXT: [indexDeclaration]: kind: variable | name: gx
@@ -98,3 +104,6 @@
   [indexEntityReference]: kind: struct-template-spec | name: TS | USR: c:@S at TS>#I | {{.*}} | loc: 55:3
 */
 // CHECK-NEXT: [indexEntityReference]: kind: c++-class-template | name: TS | USR: c:@ST>2#T#T at TS | {{.*}} | loc: 55:3
+
+// CHECK:      [indexEntityReference]: kind: variable | name: array_size | {{.*}} | loc: 59:22
+// CHECK:      [indexEntityReference]: kind: variable | name: default_param | {{.*}} | loc: 62:19

Modified: cfe/trunk/tools/libclang/IndexTypeSourceInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/IndexTypeSourceInfo.cpp?rev=150647&r1=150646&r2=150647&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/IndexTypeSourceInfo.cpp (original)
+++ cfe/trunk/tools/libclang/IndexTypeSourceInfo.cpp Wed Feb 15 19:12:04 2012
@@ -85,6 +85,11 @@
     }
     return true;
   }
+
+  bool TraverseStmt(Stmt *S) {
+    IndexCtx.indexBody(S, Parent, ParentDC);
+    return true;
+  }
 };
 
 } // anonymous namespace





More information about the cfe-commits mailing list