r361941 - [Index] Correctly set symbol kind of IndirectFieldDecl

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Wed May 29 03:11:14 PDT 2019


Author: ibiryukov
Date: Wed May 29 03:11:14 2019
New Revision: 361941

URL: http://llvm.org/viewvc/llvm-project?rev=361941&view=rev
Log:
[Index] Correctly set symbol kind of IndirectFieldDecl

Summary: The kind has been 'unknown' before, now it is 'field'.

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: jkorous, arphaman, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D62573

Added:
    cfe/trunk/test/Index/index-anonymous-union-fields.cpp
Modified:
    cfe/trunk/lib/Index/IndexSymbol.cpp

Modified: cfe/trunk/lib/Index/IndexSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexSymbol.cpp?rev=361941&r1=361940&r2=361941&view=diff
==============================================================================
--- cfe/trunk/lib/Index/IndexSymbol.cpp (original)
+++ cfe/trunk/lib/Index/IndexSymbol.cpp Wed May 29 03:11:14 2019
@@ -168,6 +168,7 @@ SymbolInfo index::getSymbolInfo(const De
       Info.Kind = SymbolKind::Function;
       break;
     case Decl::Field:
+    case Decl::IndirectField:
       Info.Kind = SymbolKind::Field;
       if (const CXXRecordDecl *
             CXXRec = dyn_cast<CXXRecordDecl>(D->getDeclContext())) {

Added: cfe/trunk/test/Index/index-anonymous-union-fields.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/index-anonymous-union-fields.cpp?rev=361941&view=auto
==============================================================================
--- cfe/trunk/test/Index/index-anonymous-union-fields.cpp (added)
+++ cfe/trunk/test/Index/index-anonymous-union-fields.cpp Wed May 29 03:11:14 2019
@@ -0,0 +1,10 @@
+struct X {
+  union {
+    void *a;
+  };
+};
+
+// RUN: c-index-test -index-file %s > %t
+// RUN: FileCheck %s -input-file=%t
+
+// CHECK: [indexDeclaration]: kind: field | name: a | {{.*}} | loc: 3:11




More information about the cfe-commits mailing list