]> granicus.if.org Git - clang/commitdiff
[libclang] Do index statements inside a type source info. rdar://10872758
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 16 Feb 2012 01:12:04 +0000 (01:12 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Thu, 16 Feb 2012 01:12:04 +0000 (01:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150647 91177308-0d34-0410-b5e6-96231b3b80d8

test/Index/index-refs.cpp
tools/libclang/IndexTypeSourceInfo.cpp

index 35f4fe403c017263e2287a3d21cf353b6a449120..fa4b4b3a09c31b93c517843ff8e4cadeeb26de8d 100644 (file)
@@ -55,6 +55,12 @@ void foo3() {
   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 @@ void foo3() {
   [indexEntityReference]: kind: struct-template-spec | name: TS | USR: c:@S@TS>#I | {{.*}} | loc: 55:3
 */
 // CHECK-NEXT: [indexEntityReference]: kind: c++-class-template | name: TS | USR: c:@ST>2#T#T@TS | {{.*}} | loc: 55:3
+
+// CHECK:      [indexEntityReference]: kind: variable | name: array_size | {{.*}} | loc: 59:22
+// CHECK:      [indexEntityReference]: kind: variable | name: default_param | {{.*}} | loc: 62:19
index 34acffcf7adec78975604b316c6d6c9daf093dd5..b62d52156bc9f9b7128fdd70734f817d5d84bc59 100644 (file)
@@ -85,6 +85,11 @@ public:
     }
     return true;
   }
+
+  bool TraverseStmt(Stmt *S) {
+    IndexCtx.indexBody(S, Parent, ParentDC);
+    return true;
+  }
 };
 
 } // anonymous namespace