r300948 - [index] For 'transparent' tag typedefs, ignore their tag reference

Argyrios Kyrtzidis via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 20 22:42:41 PDT 2017


Author: akirtzidis
Date: Fri Apr 21 00:42:40 2017
New Revision: 300948

URL: http://llvm.org/viewvc/llvm-project?rev=300948&view=rev
Log:
[index] For 'transparent' tag typedefs, ignore their tag reference

Modified:
    cfe/trunk/lib/Index/IndexDecl.cpp
    cfe/trunk/test/Index/Core/index-source.m

Modified: cfe/trunk/lib/Index/IndexDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexDecl.cpp?rev=300948&r1=300947&r2=300948&view=diff
==============================================================================
--- cfe/trunk/lib/Index/IndexDecl.cpp (original)
+++ cfe/trunk/lib/Index/IndexDecl.cpp Fri Apr 21 00:42:40 2017
@@ -231,10 +231,11 @@ public:
   }
 
   bool VisitTypedefNameDecl(const TypedefNameDecl *D) {
-    if (!D->isTransparentTag())
+    if (!D->isTransparentTag()) {
       if (!IndexCtx.handleDecl(D))
         return false;
-    IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), D);
+      IndexCtx.indexTypeSourceInfo(D->getTypeSourceInfo(), D);
+    }
     return true;
   }
 

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=300948&r1=300947&r2=300948&view=diff
==============================================================================
--- cfe/trunk/test/Index/Core/index-source.m (original)
+++ cfe/trunk/test/Index/Core/index-source.m Fri Apr 21 00:42:40 2017
@@ -353,7 +353,8 @@ typedef MyGenCls<Base *><MyEnumerating>
 
 typedef NS_ENUM(AnotherEnum, int) {
 // CHECK-NOT: [[@LINE-1]]:17 | type-alias/C | AnotherEnum |
-// CHECK: [[@LINE-2]]:17 | enum/C | AnotherEnum | [[AnotherEnum_USR:.*]] | {{.*}} | Ref,RelCont | rel: 1
+// CHECK-NOT: [[@LINE-2]]:17 | {{.*}} | Ref
+// CHECK: [[@LINE-3]]:17 | enum/C | AnotherEnum | [[AnotherEnum_USR:.*]] | {{.*}} | Def | rel: 0
   AnotherEnumFirst = 0,
   AnotherEnumSecond = 1,
   AnotherEnumThird = 2,




More information about the cfe-commits mailing list