r291700 - [index] Add 'contained-by' relation between references and their lexical container.

Argyrios Kyrtzidis via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 11 12:51:11 PST 2017


Author: akirtzidis
Date: Wed Jan 11 14:51:10 2017
New Revision: 291700

URL: http://llvm.org/viewvc/llvm-project?rev=291700&view=rev
Log:
[index] Add 'contained-by' relation between references and their lexical container.

Modified:
    cfe/trunk/include/clang/Index/IndexSymbol.h
    cfe/trunk/lib/Index/IndexSymbol.cpp
    cfe/trunk/lib/Index/IndexingContext.cpp
    cfe/trunk/test/Index/Core/designated-inits.c
    cfe/trunk/test/Index/Core/index-source.cpp
    cfe/trunk/test/Index/Core/index-source.m
    cfe/trunk/test/Index/Core/index-subkinds.m
    cfe/trunk/test/Index/Core/index-with-module.m

Modified: cfe/trunk/include/clang/Index/IndexSymbol.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Index/IndexSymbol.h?rev=291700&r1=291699&r2=291700&view=diff
==============================================================================
--- cfe/trunk/include/clang/Index/IndexSymbol.h (original)
+++ cfe/trunk/include/clang/Index/IndexSymbol.h Wed Jan 11 14:51:10 2017
@@ -80,7 +80,7 @@ static const unsigned SymbolPropertyBitN
 typedef unsigned SymbolPropertySet;
 
 /// Set of roles that are attributed to symbol occurrences.
-enum class SymbolRole : uint16_t {
+enum class SymbolRole : uint32_t {
   Declaration = 1 << 0,
   Definition  = 1 << 1,
   Reference   = 1 << 2,
@@ -99,8 +99,9 @@ enum class SymbolRole : uint16_t {
   RelationCalledBy    = 1 << 13,
   RelationExtendedBy  = 1 << 14,
   RelationAccessorOf  = 1 << 15,
+  RelationContainedBy = 1 << 16,
 };
-static const unsigned SymbolRoleBitNum = 16;
+static const unsigned SymbolRoleBitNum = 17;
 typedef unsigned SymbolRoleSet;
 
 /// Represents a relation to another symbol for a symbol occurrence.

Modified: cfe/trunk/lib/Index/IndexSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexSymbol.cpp?rev=291700&r1=291699&r2=291700&view=diff
==============================================================================
--- cfe/trunk/lib/Index/IndexSymbol.cpp (original)
+++ cfe/trunk/lib/Index/IndexSymbol.cpp Wed Jan 11 14:51:10 2017
@@ -289,6 +289,7 @@ void index::applyForEachSymbolRole(Symbo
   APPLY_FOR_ROLE(RelationCalledBy);
   APPLY_FOR_ROLE(RelationExtendedBy);
   APPLY_FOR_ROLE(RelationAccessorOf);
+  APPLY_FOR_ROLE(RelationContainedBy);
 
 #undef APPLY_FOR_ROLE
 }
@@ -317,6 +318,7 @@ void index::printSymbolRoles(SymbolRoleS
     case SymbolRole::RelationCalledBy: OS << "RelCall"; break;
     case SymbolRole::RelationExtendedBy: OS << "RelExt"; break;
     case SymbolRole::RelationAccessorOf: OS << "RelAcc"; break;
+    case SymbolRole::RelationContainedBy: OS << "RelCont"; break;
     }
   });
 }

Modified: cfe/trunk/lib/Index/IndexingContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexingContext.cpp?rev=291700&r1=291699&r2=291700&view=diff
==============================================================================
--- cfe/trunk/lib/Index/IndexingContext.cpp (original)
+++ cfe/trunk/lib/Index/IndexingContext.cpp Wed Jan 11 14:51:10 2017
@@ -312,9 +312,14 @@ bool IndexingContext::handleDeclOccurren
     Roles |= Rel.Roles;
   };
 
-  if (!IsRef && Parent && !cast<DeclContext>(Parent)->isFunctionOrMethod()) {
-    addRelation(SymbolRelation{(unsigned)SymbolRole::RelationChildOf, Parent});
+  if (Parent) {
+    if (IsRef) {
+      addRelation(SymbolRelation{(unsigned)SymbolRole::RelationContainedBy, Parent});
+    } else if (!cast<DeclContext>(Parent)->isFunctionOrMethod()) {
+      addRelation(SymbolRelation{(unsigned)SymbolRole::RelationChildOf, Parent});
+    }
   }
+
   for (auto &Rel : Relations) {
     addRelation(SymbolRelation(Rel.Roles,
                                Rel.RelatedSymbol->getCanonicalDecl()));

Modified: cfe/trunk/test/Index/Core/designated-inits.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/Core/designated-inits.c?rev=291700&r1=291699&r2=291700&view=diff
==============================================================================
--- cfe/trunk/test/Index/Core/designated-inits.c (original)
+++ cfe/trunk/test/Index/Core/designated-inits.c Wed Jan 11 14:51:10 2017
@@ -5,7 +5,7 @@ struct MyStruct {
 };
 
 enum {
-  MyValToSet;
+  MyValToSet
 };
 
 // CHECK: [[@LINE+1]]:14 | struct/C | MyStruct |
@@ -20,7 +20,7 @@ const struct MyStruct _MyStruct[]
       [0] = {
         [0][0] = {
           [0] = {
-            // CHECK: [[@LINE+2]]:14 | field/C | myfield | {{.*}} | Ref |
+            // CHECK: [[@LINE+2]]:14 | field/C | myfield | {{.*}} | Ref,RelCont |
             // CHECK: [[@LINE+1]]:24 | enumerator/C | MyValToSet |
             .myfield = MyValToSet,
             // CHECK-NOT: | field/C | myfield |

Modified: cfe/trunk/test/Index/Core/index-source.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/Core/index-source.cpp?rev=291700&r1=291699&r2=291700&view=diff
==============================================================================
--- cfe/trunk/test/Index/Core/index-source.cpp (original)
+++ cfe/trunk/test/Index/Core/index-source.cpp Wed Jan 11 14:51:10 2017
@@ -21,7 +21,7 @@ public:
 };
 
 TemplCls<int> gtv(0);
-// CHECK: [[@LINE-1]]:1 | class(Gen)/C++ | TemplCls | c:@ST>1#T at TemplCls | <no-cgname> | Ref | rel: 0
+// CHECK: [[@LINE-1]]:1 | class(Gen)/C++ | TemplCls | c:@ST>1#T at TemplCls | <no-cgname> | Ref,RelCont | rel: 1
 
 template <typename T>
 class BT {
@@ -38,7 +38,7 @@ class BT {
 // CHECK: [[@LINE+1]]:23 | type-alias/C | size_t |
 typedef unsigned long size_t;
 // CHECK: [[@LINE+2]]:7 | function/C | operator new | c:@F at operator new#l# | __Znwm |
-// CHECK: [[@LINE+1]]:20 | type-alias/C | size_t | {{.*}} | Ref |
+// CHECK: [[@LINE+1]]:20 | type-alias/C | size_t | {{.*}} | Ref,RelCont |
 void* operator new(size_t sz);
 
 // CHECK: [[@LINE+1]]:37 | variable(Gen)/C++ | tmplVar | c:index-source.cpp at VT>1#T at tmplVar | __ZL7tmplVar | Def | rel: 0
@@ -46,8 +46,8 @@ template<typename T> static const T tmpl
 // CHECK: [[@LINE+1]]:29 | variable(Gen,TS)/C++ | tmplVar | c:index-source.cpp at tmplVar>#I | __ZL7tmplVarIiE | Def | rel: 0
 template<> static const int tmplVar<int> = 0;
 // CHECK: [[@LINE+2]]:5 | variable/C | gvi | c:@gvi | _gvi | Def | rel: 0
-// CHECK: [[@LINE+1]]:11 | variable(Gen,TS)/C++ | tmplVar | c:index-source.cpp at tmplVar>#I | __ZL7tmplVarIiE | Ref,Read | rel: 0
+// CHECK: [[@LINE+1]]:11 | variable(Gen,TS)/C++ | tmplVar | c:index-source.cpp at tmplVar>#I | __ZL7tmplVarIiE | Ref,Read,RelCont | rel: 1
 int gvi = tmplVar<int>;
 // CHECK: [[@LINE+2]]:5 | variable/C | gvf | c:@gvf | _gvf | Def | rel: 0
-// CHECK: [[@LINE+1]]:11 | variable(Gen)/C++ | tmplVar | c:index-source.cpp at VT>1#T at tmplVar | __ZL7tmplVar | Ref,Read | rel: 0
+// CHECK: [[@LINE+1]]:11 | variable(Gen)/C++ | tmplVar | c:index-source.cpp at VT>1#T at tmplVar | __ZL7tmplVar | Ref,Read,RelCont | rel: 1
 int gvf = tmplVar<float>;

Modified: cfe/trunk/test/Index/Core/index-source.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/Core/index-source.m?rev=291700&r1=291699&r2=291700&view=diff
==============================================================================
--- cfe/trunk/test/Index/Core/index-source.m (original)
+++ cfe/trunk/test/Index/Core/index-source.m Wed Jan 11 14:51:10 2017
@@ -5,18 +5,35 @@
 -(void)meth;
 // CHECK: [[@LINE-1]]:1 | instance-method/ObjC | meth | c:objc(cs)Base(im)meth | -[Base meth] | Decl,Dyn,RelChild | rel: 1
 // CHECK-NEXT: RelChild | Base | c:objc(cs)Base
++(Base*)class_meth;
+// CHECK: [[@LINE-1]]:1 | class-method/ObjC | class_meth | c:objc(cs)Base(cm)class_meth | +[Base class_meth] | Decl,Dyn,RelChild | rel: 1
+// CHECK: [[@LINE-2]]:3 | class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Ref,RelCont | rel: 1
+// CHECK-NEXT: RelCont | class_meth | c:objc(cs)Base(cm)class_meth
+
 @end
 
 void foo();
-// CHECK: [[@LINE+1]]:6 | function/C | goo | c:@F at goo | _goo | Def | rel: 0
+// CHECK: [[@LINE+3]]:6 | function/C | goo | c:@F at goo | _goo | Def | rel: 0
+// CHECK: [[@LINE+2]]:10 | class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Ref,RelCont | rel: 1
+// CHECK-NEXT: RelCont | goo | c:@F at goo
 void goo(Base *b) {
-  // CHECK: [[@LINE+2]]:3 | function/C | foo | c:@F at foo | _foo | Ref,Call,RelCall | rel: 1
-  // CHECK-NEXT: RelCall | goo | c:@F at goo
+  // CHECK: [[@LINE+2]]:3 | function/C | foo | c:@F at foo | _foo | Ref,Call,RelCall,RelCont | rel: 1
+  // CHECK-NEXT: RelCall,RelCont | goo | c:@F at goo
   foo();
-  // CHECK: [[@LINE+3]]:6 | instance-method/ObjC | meth | c:objc(cs)Base(im)meth | -[Base meth] | Ref,Call,Dyn,RelRec,RelCall | rel: 2
-  // CHECK-NEXT: RelCall | goo | c:@F at goo
+  // CHECK: [[@LINE+3]]:6 | instance-method/ObjC | meth | c:objc(cs)Base(im)meth | -[Base meth] | Ref,Call,Dyn,RelRec,RelCall,RelCont | rel: 2
+  // CHECK-NEXT: RelCall,RelCont | goo | c:@F at goo
   // CHECK-NEXT: RelRec | Base | c:objc(cs)Base
   [b meth];
+
+  // CHECK: [[@LINE+2]]:4 | class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Ref,RelCont | rel: 1
+  // CHECK-NEXT: RelCont | goo | c:@F at goo
+  [Base class_meth];
+
+  // CHECK: [[@LINE+4]]:3 | class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Ref,RelCont | rel: 1
+  // CHECK-NEXT: RelCont | goo | c:@F at goo
+  // CHECK: [[@LINE+2]]:14 | class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Ref,RelCont | rel: 1
+  // CHECK-NEXT: RelCont | goo | c:@F at goo
+  Base *f = (Base *) 2;
 }
 
 // CHECK: [[@LINE+1]]:11 | protocol/ObjC | Prot1 | c:objc(pl)Prot1 | <no-cgname> | Decl | rel: 0
@@ -24,18 +41,18 @@ void goo(Base *b) {
 @end
 
 // CHECK: [[@LINE+3]]:11 | protocol/ObjC | Prot2 | c:objc(pl)Prot2 | <no-cgname> | Decl | rel: 0
-// CHECK: [[@LINE+2]]:17 | protocol/ObjC | Prot1 | c:objc(pl)Prot1 | <no-cgname> | Ref,RelBase | rel: 1
-// CHECK-NEXT: RelBase | Prot2 | c:objc(pl)Prot2
+// CHECK: [[@LINE+2]]:17 | protocol/ObjC | Prot1 | c:objc(pl)Prot1 | <no-cgname> | Ref,RelBase,RelCont | rel: 1
+// CHECK-NEXT: RelBase,RelCont | Prot2 | c:objc(pl)Prot2
 @protocol Prot2<Prot1>
 @end
 
 // CHECK: [[@LINE+7]]:12 | class/ObjC | Sub | c:objc(cs)Sub | _OBJC_CLASS_$_Sub | Decl | rel: 0
-// CHECK: [[@LINE+6]]:18 | class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Ref,RelBase | rel: 1
-// CHECK-NEXT: RelBase | Sub | c:objc(cs)Sub
-// CHECK: [[@LINE+4]]:23 | protocol/ObjC | Prot2 | c:objc(pl)Prot2 | <no-cgname> | Ref,RelBase | rel: 1
-// CHECK-NEXT: RelBase | Sub | c:objc(cs)Sub
-// CHECK: [[@LINE+2]]:30 | protocol/ObjC | Prot1 | c:objc(pl)Prot1 | <no-cgname> | Ref,RelBase | rel: 1
-// CHECK-NEXT: RelBase | Sub | c:objc(cs)Sub
+// CHECK: [[@LINE+6]]:18 | class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Ref,RelBase,RelCont | rel: 1
+// CHECK-NEXT: RelBase,RelCont | Sub | c:objc(cs)Sub
+// CHECK: [[@LINE+4]]:23 | protocol/ObjC | Prot2 | c:objc(pl)Prot2 | <no-cgname> | Ref,RelBase,RelCont | rel: 1
+// CHECK-NEXT: RelBase,RelCont | Sub | c:objc(cs)Sub
+// CHECK: [[@LINE+2]]:30 | protocol/ObjC | Prot1 | c:objc(pl)Prot1 | <no-cgname> | Ref,RelBase,RelCont | rel: 1
+// CHECK-NEXT: RelBase,RelCont | Sub | c:objc(cs)Sub
 @interface Sub : Base<Prot2, Prot1>
 @end
 
@@ -68,8 +85,9 @@ enum {
 
 // CHECK: [[@LINE+1]]:13 | type-alias/C | jmp_buf | c:index-source.m at T@jmp_buf | <no-cgname> | Def | rel: 0
 typedef int jmp_buf[(18)];
-// CHECK: [[@LINE+2]]:12 | function/C | setjmp | c:@F at setjmp | _setjmp | Decl | rel: 0
-// CHECK: [[@LINE+1]]:19 | type-alias/C | jmp_buf | c:index-source.m at T@jmp_buf | <no-cgname> | Ref | rel: 0
+// CHECK: [[@LINE+3]]:12 | function/C | setjmp | c:@F at setjmp | _setjmp | Decl | rel: 0
+// CHECK: [[@LINE+2]]:19 | type-alias/C | jmp_buf | c:index-source.m at T@jmp_buf | <no-cgname> | Ref,RelCont | rel: 1
+// CHECK-NEXT: RelCont | setjmp | c:@F at setjmp
 extern int setjmp(jmp_buf);
 
 @class I1;
@@ -85,7 +103,8 @@ extern int setjmp(jmp_buf);
 // CHECK: [[@LINE+2]]:17 | field/ObjC | _prop | c:objc(cs)I2 at _prop | <no-cgname> | Def,Impl,RelChild | rel: 1
 // CHECK-NEXT: RelChild | I2 | c:objc(cs)I2
 @implementation I2
-// CHECK: [[@LINE+5]]:13 | instance-property/ObjC | prop | c:objc(cs)I2(py)prop | <no-cgname> | Ref | rel: 0
+// CHECK: [[@LINE+6]]:13 | instance-property/ObjC | prop | c:objc(cs)I2(py)prop | <no-cgname> | Ref,RelCont | rel: 1
+// CHECK-NEXT: RelCont | I2 | c:objc(cs)I2
 // CHECK: [[@LINE+4]]:13 | instance-method/ObjC | prop | c:objc(cs)I2(im)prop | -[I2 prop] | Def,RelChild | rel: 1
 // CHECK-NEXT: RelChild | I2 | c:objc(cs)I2
 // CHECK: [[@LINE+2]]:13 | instance-method/ObjC | setProp: | c:objc(cs)I2(im)setProp: | -[I2 setProp:] | Def,RelChild | rel: 1
@@ -107,21 +126,22 @@ extern int setjmp(jmp_buf);
 
 // CHECK: [[@LINE+1]]:17 | class/ObjC | I3 | c:objc(cs)I3 | <no-cgname> | Def | rel: 0
 @implementation I3
-// CHECK: [[@LINE+3]]:13 | instance-property/ObjC | prop | c:objc(cs)I3(py)prop | <no-cgname> | Ref | rel: 0
+// CHECK: [[@LINE+4]]:13 | instance-property/ObjC | prop | c:objc(cs)I3(py)prop | <no-cgname> | Ref,RelCont | rel: 1
+// CHECK-NEXT: RelCont | I3 | c:objc(cs)I3
 // CHECK: [[@LINE+2]]:13 | instance-method/ObjC | prop | c:objc(cs)I3(im)prop | -[I3 prop] | Def,RelChild | rel: 1
 // CHECK: [[@LINE+1]]:13 | instance-method/ObjC | setProp: | c:objc(cs)I3(im)setProp: | -[I3 setProp:] | Def,RelChild | rel: 1
 @synthesize prop = _prop;
 @end
 
-// CHECK: [[@LINE+5]]:12 | class/ObjC | I3 | c:objc(cs)I3 | _OBJC_CLASS_$_I3 | Ref,RelExt | rel: 1
-// CHECK-NEXT: RelExt | bar | c:objc(cy)I3 at bar
+// CHECK: [[@LINE+5]]:12 | class/ObjC | I3 | c:objc(cs)I3 | _OBJC_CLASS_$_I3 | Ref,RelExt,RelCont | rel: 1
+// CHECK-NEXT: RelExt,RelCont | bar | c:objc(cy)I3 at bar
 // CHECK: [[@LINE+3]]:15 | extension/ObjC | bar | c:objc(cy)I3 at bar | <no-cgname> | Decl | rel: 0
-// CHECK: [[@LINE+2]]:21 | protocol/ObjC | Prot1 | c:objc(pl)Prot1 | <no-cgname> | Ref,RelBase | rel: 1
-// CHECK-NEXT: RelBase | bar | c:objc(cy)I3 at bar
+// CHECK: [[@LINE+2]]:21 | protocol/ObjC | Prot1 | c:objc(pl)Prot1 | <no-cgname> | Ref,RelBase,RelCont | rel: 1
+// CHECK-NEXT: RelBase,RelCont | bar | c:objc(cy)I3 at bar
 @interface I3(bar) <Prot1>
 @end
 
-// CHECK: [[@LINE+2]]:17 | class/ObjC | I3 | c:objc(cs)I3 | _OBJC_CLASS_$_I3 | Ref | rel: 0
+// CHECK: [[@LINE+2]]:17 | class/ObjC | I3 | c:objc(cs)I3 | _OBJC_CLASS_$_I3 | Ref,RelCont | rel: 1
 // CHECK: [[@LINE+1]]:20 | extension/ObjC | I3 | c:objc(cy)I3 at bar | <no-cgname> | Def | rel: 0
 @implementation I3(bar)
 @end
@@ -137,15 +157,15 @@ extern int setjmp(jmp_buf);
 @end
 
 // CHECK: [[@LINE+4]]:41 | type-alias/C | MyEnumerator | c:index-source.m at T@MyEnumerator | <no-cgname> | Def | rel: 0
-// CHECK: [[@LINE+3]]:26 | protocol/ObjC | MyEnumerating | c:objc(pl)MyEnumerating | <no-cgname> | Ref | rel: 0
-// CHECK: [[@LINE+2]]:9 | class/ObjC | MyGenCls | c:objc(cs)MyGenCls | _OBJC_CLASS_$_MyGenCls | Ref | rel: 0
-// CHECK: [[@LINE+1]]:18 | class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Ref | rel: 0
+// CHECK: [[@LINE+3]]:26 | protocol/ObjC | MyEnumerating | c:objc(pl)MyEnumerating | <no-cgname> | Ref,RelCont | rel: 1
+// CHECK: [[@LINE+2]]:9 | class/ObjC | MyGenCls | c:objc(cs)MyGenCls | _OBJC_CLASS_$_MyGenCls | Ref,RelCont | rel: 1
+// CHECK: [[@LINE+1]]:18 | class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Ref,RelCont | rel: 1
 typedef MyGenCls<Base *><MyEnumerating> MyEnumerator;
 
 // CHECK: [[@LINE+5]]:12 | class/ObjC | PermanentEnumerator | c:objc(cs)PermanentEnumerator | _OBJC_CLASS_$_PermanentEnumerator | Decl | rel: 0
-// CHECK: [[@LINE+4]]:34 | class/ObjC | MyGenCls | c:objc(cs)MyGenCls | _OBJC_CLASS_$_MyGenCls | Ref,RelBase | rel: 1
-// CHECK-NEXT: RelBase | PermanentEnumerator | c:objc(cs)PermanentEnumerator
-// CHECK: [[@LINE+2]]:34 | protocol/ObjC | MyEnumerating | c:objc(pl)MyEnumerating | <no-cgname> | Ref,RelBase | rel: 1
-// CHECK-NEXT: RelBase | PermanentEnumerator | c:objc(cs)PermanentEnumerator
+// CHECK: [[@LINE+4]]:34 | class/ObjC | MyGenCls | c:objc(cs)MyGenCls | _OBJC_CLASS_$_MyGenCls | Ref,RelBase,RelCont | rel: 1
+// CHECK-NEXT: RelBase,RelCont | PermanentEnumerator | c:objc(cs)PermanentEnumerator
+// CHECK: [[@LINE+2]]:34 | protocol/ObjC | MyEnumerating | c:objc(pl)MyEnumerating | <no-cgname> | Ref,RelBase,RelCont | rel: 1
+// CHECK-NEXT: RelBase,RelCont | PermanentEnumerator | c:objc(cs)PermanentEnumerator
 @interface PermanentEnumerator : MyEnumerator
 @end

Modified: cfe/trunk/test/Index/Core/index-subkinds.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/Core/index-subkinds.m?rev=291700&r1=291699&r2=291700&view=diff
==============================================================================
--- cfe/trunk/test/Index/Core/index-subkinds.m (original)
+++ cfe/trunk/test/Index/Core/index-subkinds.m Wed Jan 11 14:51:10 2017
@@ -26,12 +26,12 @@
 -(void)testIt2 {}
 @end
 
-// CHECK: [[@LINE+3]]:12 | class(test)/ObjC | MyTestCase | c:objc(cs)MyTestCase | _OBJC_CLASS_$_MyTestCase | Ref,RelExt | rel: 1
-// CHECK-NEXT: RelExt | cat | c:objc(cy)MyTestCase at cat
+// CHECK: [[@LINE+3]]:12 | class(test)/ObjC | MyTestCase | c:objc(cs)MyTestCase | _OBJC_CLASS_$_MyTestCase | Ref,RelExt,RelCont | rel: 1
+// CHECK-NEXT: RelExt,RelCont | cat | c:objc(cy)MyTestCase at cat
 // CHECK: [[@LINE+1]]:23 | extension/ObjC | cat | c:objc(cy)MyTestCase at cat | <no-cgname> | Decl | rel: 0
 @interface MyTestCase(cat)
 @end
-// CHECK: [[@LINE+2]]:17 | class(test)/ObjC | MyTestCase | c:objc(cs)MyTestCase | _OBJC_CLASS_$_MyTestCase | Ref | rel: 0
+// CHECK: [[@LINE+2]]:17 | class(test)/ObjC | MyTestCase | c:objc(cs)MyTestCase | _OBJC_CLASS_$_MyTestCase | Ref,RelCont | rel: 1
 // CHECK: [[@LINE+1]]:28 | extension/ObjC | MyTestCase | c:objc(cy)MyTestCase at cat | <no-cgname> | Def | rel: 0
 @implementation MyTestCase(cat)
 // CHECK: [[@LINE+1]]:1 | instance-method(test)/ObjC | testInCat | c:objc(cs)MyTestCase(im)testInCat | -[MyTestCase(cat) testInCat] | Def,Dyn,RelChild | rel: 1

Modified: cfe/trunk/test/Index/Core/index-with-module.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/Core/index-with-module.m?rev=291700&r1=291699&r2=291700&view=diff
==============================================================================
--- cfe/trunk/test/Index/Core/index-with-module.m (original)
+++ cfe/trunk/test/Index/Core/index-with-module.m Wed Jan 11 14:51:10 2017
@@ -7,6 +7,6 @@
 #include "ModA.h"
 
 void foo() {
-  // CHECK: [[@LINE+1]]:3 | function/C | ModA_func | c:@F at ModA_func | {{.*}} | Ref,Call,RelCall | rel: 1
+  // CHECK: [[@LINE+1]]:3 | function/C | ModA_func | c:@F at ModA_func | {{.*}} | Ref,Call,RelCall,RelCont | rel: 1
   ModA_func();
 }




More information about the cfe-commits mailing list