r264423 - [index] Remove redundancy between symbol kind and language

Ben Langmuir via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 25 10:02:00 PDT 2016


Author: benlangmuir
Date: Fri Mar 25 12:01:59 2016
New Revision: 264423

URL: http://llvm.org/viewvc/llvm-project?rev=264423&view=rev
Log:
[index] Remove redundancy between symbol kind and language

Condense the ObjCKIND and CXXKIND options into just KIND, since the
language was already specified on a per-symbol basis and this
information was redundant. This only changes the internal
representation; naturally the libclang interface remains the same.

Modified:
    cfe/trunk/include/clang/Index/IndexSymbol.h
    cfe/trunk/lib/Index/IndexSymbol.cpp
    cfe/trunk/test/Index/Core/index-source.cpp
    cfe/trunk/test/Index/Core/index-source.m
    cfe/trunk/tools/libclang/CXIndexDataConsumer.cpp

Modified: cfe/trunk/include/clang/Index/IndexSymbol.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Index/IndexSymbol.h?rev=264423&r1=264422&r2=264423&view=diff
==============================================================================
--- cfe/trunk/include/clang/Index/IndexSymbol.h (original)
+++ cfe/trunk/include/clang/Index/IndexSymbol.h Fri Mar 25 12:01:59 2016
@@ -24,38 +24,33 @@ enum class SymbolKind : uint8_t {
   Unknown,
 
   Module,
+  Namespace,
+  NamespaceAlias,
   Macro,
 
   Enum,
   Struct,
+  Class,
+  Protocol,
+  Extension,
   Union,
-  Typedef,
+  TypeAlias,
 
   Function,
   Variable,
   Field,
   EnumConstant,
 
-  ObjCClass,
-  ObjCProtocol,
-  ObjCCategory,
-
-  ObjCInstanceMethod,
-  ObjCClassMethod,
-  ObjCProperty,
-  ObjCIvar,
-
-  CXXClass,
-  CXXNamespace,
-  CXXNamespaceAlias,
-  CXXStaticVariable,
-  CXXStaticMethod,
-  CXXInstanceMethod,
-  CXXConstructor,
-  CXXDestructor,
-  CXXConversionFunction,
-  CXXTypeAlias,
-  CXXInterface,
+  InstanceMethod,
+  ClassMethod,
+  StaticMethod,
+  InstanceProperty,
+  ClassProperty,
+  StaticProperty,
+
+  Constructor,
+  Destructor,
+  ConversionFunction,
 };
 
 enum class SymbolLanguage {

Modified: cfe/trunk/lib/Index/IndexSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Index/IndexSymbol.cpp?rev=264423&r1=264422&r2=264423&view=diff
==============================================================================
--- cfe/trunk/lib/Index/IndexSymbol.cpp (original)
+++ cfe/trunk/lib/Index/IndexSymbol.cpp Fri Mar 25 12:01:59 2016
@@ -30,11 +30,11 @@ SymbolInfo index::getSymbolInfo(const De
     case TTK_Union:
       Info.Kind = SymbolKind::Union; break;
     case TTK_Class:
-      Info.Kind = SymbolKind::CXXClass;
+      Info.Kind = SymbolKind::Class;
       Info.Lang = SymbolLanguage::CXX;
       break;
     case TTK_Interface:
-      Info.Kind = SymbolKind::CXXInterface;
+      Info.Kind = SymbolKind::Protocol;
       Info.Lang = SymbolLanguage::CXX;
       break;
     case TTK_Enum:
@@ -57,7 +57,7 @@ SymbolInfo index::getSymbolInfo(const De
       Info.Kind = SymbolKind::Module;
       break;
     case Decl::Typedef:
-      Info.Kind = SymbolKind::Typedef; break;
+      Info.Kind = SymbolKind::TypeAlias; break; // Lang = C
     case Decl::Function:
       Info.Kind = SymbolKind::Function;
       break;
@@ -67,7 +67,7 @@ SymbolInfo index::getSymbolInfo(const De
     case Decl::Var:
       Info.Kind = SymbolKind::Variable;
       if (isa<CXXRecordDecl>(D->getDeclContext())) {
-        Info.Kind = SymbolKind::CXXStaticVariable;
+        Info.Kind = SymbolKind::StaticProperty;
         Info.Lang = SymbolLanguage::CXX;
       }
       break;
@@ -83,91 +83,94 @@ SymbolInfo index::getSymbolInfo(const De
       Info.Kind = SymbolKind::EnumConstant; break;
     case Decl::ObjCInterface:
     case Decl::ObjCImplementation:
-      Info.Kind = SymbolKind::ObjCClass;
+      Info.Kind = SymbolKind::Class;
       Info.Lang = SymbolLanguage::ObjC;
       break;
     case Decl::ObjCProtocol:
-      Info.Kind = SymbolKind::ObjCProtocol;
+      Info.Kind = SymbolKind::Protocol;
       Info.Lang = SymbolLanguage::ObjC;
       break;
     case Decl::ObjCCategory:
     case Decl::ObjCCategoryImpl:
-      Info.Kind = SymbolKind::ObjCCategory;
+      Info.Kind = SymbolKind::Extension;
       Info.Lang = SymbolLanguage::ObjC;
       break;
     case Decl::ObjCMethod:
       if (cast<ObjCMethodDecl>(D)->isInstanceMethod())
-        Info.Kind = SymbolKind::ObjCInstanceMethod;
+        Info.Kind = SymbolKind::InstanceMethod;
       else
-        Info.Kind = SymbolKind::ObjCClassMethod;
+        Info.Kind = SymbolKind::ClassMethod;
       Info.Lang = SymbolLanguage::ObjC;
       break;
     case Decl::ObjCProperty:
-      Info.Kind = SymbolKind::ObjCProperty;
+      Info.Kind = SymbolKind::InstanceProperty;
       Info.Lang = SymbolLanguage::ObjC;
       break;
     case Decl::ObjCIvar:
-      Info.Kind = SymbolKind::ObjCIvar;
+      Info.Kind = SymbolKind::Field;
       Info.Lang = SymbolLanguage::ObjC;
       break;
     case Decl::Namespace:
-      Info.Kind = SymbolKind::CXXNamespace;
+      Info.Kind = SymbolKind::Namespace;
       Info.Lang = SymbolLanguage::CXX;
       break;
     case Decl::NamespaceAlias:
-      Info.Kind = SymbolKind::CXXNamespaceAlias;
+      Info.Kind = SymbolKind::NamespaceAlias;
       Info.Lang = SymbolLanguage::CXX;
       break;
     case Decl::CXXConstructor:
-      Info.Kind = SymbolKind::CXXConstructor;
+      Info.Kind = SymbolKind::Constructor;
       Info.Lang = SymbolLanguage::CXX;
       break;
     case Decl::CXXDestructor:
-      Info.Kind = SymbolKind::CXXDestructor;
+      Info.Kind = SymbolKind::Destructor;
       Info.Lang = SymbolLanguage::CXX;
       break;
     case Decl::CXXConversion:
-      Info.Kind = SymbolKind::CXXConversionFunction;
+      Info.Kind = SymbolKind::ConversionFunction;
       Info.Lang = SymbolLanguage::CXX;
       break;
     case Decl::CXXMethod: {
       const CXXMethodDecl *MD = cast<CXXMethodDecl>(D);
       if (MD->isStatic())
-        Info.Kind = SymbolKind::CXXStaticMethod;
+        Info.Kind = SymbolKind::StaticMethod;
       else
-        Info.Kind = SymbolKind::CXXInstanceMethod;
+        Info.Kind = SymbolKind::InstanceMethod;
       Info.Lang = SymbolLanguage::CXX;
       break;
     }
     case Decl::ClassTemplate:
-      Info.Kind = SymbolKind::CXXClass;
+      Info.Kind = SymbolKind::Class;
       Info.TemplateKind = SymbolCXXTemplateKind::Template;
+      Info.Lang = SymbolLanguage::CXX;
       break;
     case Decl::FunctionTemplate:
       Info.Kind = SymbolKind::Function;
       Info.TemplateKind = SymbolCXXTemplateKind::Template;
+      Info.Lang = SymbolLanguage::CXX;
       if (const CXXMethodDecl *MD = dyn_cast_or_null<CXXMethodDecl>(
                            cast<FunctionTemplateDecl>(D)->getTemplatedDecl())) {
         if (isa<CXXConstructorDecl>(MD))
-          Info.Kind = SymbolKind::CXXConstructor;
+          Info.Kind = SymbolKind::Constructor;
         else if (isa<CXXDestructorDecl>(MD))
-          Info.Kind = SymbolKind::CXXDestructor;
+          Info.Kind = SymbolKind::Destructor;
         else if (isa<CXXConversionDecl>(MD))
-          Info.Kind = SymbolKind::CXXConversionFunction;
+          Info.Kind = SymbolKind::ConversionFunction;
         else {
           if (MD->isStatic())
-            Info.Kind = SymbolKind::CXXStaticMethod;
+            Info.Kind = SymbolKind::StaticMethod;
           else
-            Info.Kind = SymbolKind::CXXInstanceMethod;
+            Info.Kind = SymbolKind::InstanceMethod;
         }
       }
       break;
     case Decl::TypeAliasTemplate:
-      Info.Kind = SymbolKind::CXXTypeAlias;
+      Info.Kind = SymbolKind::TypeAlias;
+      Info.Lang = SymbolLanguage::CXX;
       Info.TemplateKind = SymbolCXXTemplateKind::Template;
       break;
     case Decl::TypeAlias:
-      Info.Kind = SymbolKind::CXXTypeAlias;
+      Info.Kind = SymbolKind::TypeAlias;
       Info.Lang = SymbolLanguage::CXX;
       break;
     default:
@@ -262,33 +265,29 @@ StringRef index::getSymbolKindString(Sym
   switch (K) {
   case SymbolKind::Unknown: return "<unknown>";
   case SymbolKind::Module: return "module";
+  case SymbolKind::Namespace: return "namespace";
+  case SymbolKind::NamespaceAlias: return "namespace-alias";
   case SymbolKind::Macro: return "macro";
   case SymbolKind::Enum: return "enum";
   case SymbolKind::Struct: return "struct";
+  case SymbolKind::Class: return "class";
+  case SymbolKind::Protocol: return "protocol";
+  case SymbolKind::Extension: return "extension";
   case SymbolKind::Union: return "union";
-  case SymbolKind::Typedef: return "typedef";
+  case SymbolKind::TypeAlias: return "type-alias";
   case SymbolKind::Function: return "function";
   case SymbolKind::Variable: return "variable";
   case SymbolKind::Field: return "field";
   case SymbolKind::EnumConstant: return "enumerator";
-  case SymbolKind::ObjCClass: return "objc-class";
-  case SymbolKind::ObjCProtocol: return "objc-protocol";
-  case SymbolKind::ObjCCategory: return "objc-category";
-  case SymbolKind::ObjCInstanceMethod: return "objc-instance-method";
-  case SymbolKind::ObjCClassMethod: return "objc-class-method";
-  case SymbolKind::ObjCProperty: return "objc-property";
-  case SymbolKind::ObjCIvar: return "objc-ivar";
-  case SymbolKind::CXXClass: return "c++-class";
-  case SymbolKind::CXXNamespace: return "namespace";
-  case SymbolKind::CXXNamespaceAlias: return "namespace-alias";
-  case SymbolKind::CXXStaticVariable: return "c++-static-var";
-  case SymbolKind::CXXStaticMethod: return "c++-static-method";
-  case SymbolKind::CXXInstanceMethod: return "c++-instance-method";
-  case SymbolKind::CXXConstructor: return "constructor";
-  case SymbolKind::CXXDestructor: return "destructor";
-  case SymbolKind::CXXConversionFunction: return "coversion-func";
-  case SymbolKind::CXXTypeAlias: return "type-alias";
-  case SymbolKind::CXXInterface: return "c++-__interface";
+  case SymbolKind::InstanceMethod: return "instance-method";
+  case SymbolKind::ClassMethod: return "class-method";
+  case SymbolKind::StaticMethod: return "static-method";
+  case SymbolKind::InstanceProperty: return "instance-property";
+  case SymbolKind::ClassProperty: return "class-property";
+  case SymbolKind::StaticProperty: return "static-property";
+  case SymbolKind::Constructor: return "constructor";
+  case SymbolKind::Destructor: return "destructor";
+  case SymbolKind::ConversionFunction: return "coversion-func";
   }
   llvm_unreachable("invalid symbol kind");
 }

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=264423&r1=264422&r2=264423&view=diff
==============================================================================
--- cfe/trunk/test/Index/Core/index-source.cpp (original)
+++ cfe/trunk/test/Index/Core/index-source.cpp Fri Mar 25 12:01:59 2016
@@ -2,7 +2,7 @@
 
 template <typename TemplArg>
 class TemplCls {
-// CHECK: [[@LINE-1]]:7 | c++-class/C++ | TemplCls | c:@ST>1#T at TemplCls | <no-cgname> | Def | rel: 0
+// CHECK: [[@LINE-1]]:7 | class/C++ | TemplCls | c:@ST>1#T at TemplCls | <no-cgname> | Def | rel: 0
   TemplCls(int x);
   // CHECK: [[@LINE-1]]:3 | constructor/C++ | TemplCls | c:@ST>1#T at TemplCls@F at TemplCls#I# | <no-cgname> | Decl,RelChild | rel: 1
   // CHECK-NEXT: RelChild | TemplCls | c:@ST>1#T at TemplCls

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=264423&r1=264422&r2=264423&view=diff
==============================================================================
--- cfe/trunk/test/Index/Core/index-source.m (original)
+++ cfe/trunk/test/Index/Core/index-source.m Fri Mar 25 12:01:59 2016
@@ -1,9 +1,9 @@
 // RUN: c-index-test core -print-source-symbols -- %s -target x86_64-apple-macosx10.7 | FileCheck %s
 
 @interface Base
-// CHECK: [[@LINE-1]]:12 | objc-class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Decl | rel: 0
+// CHECK: [[@LINE-1]]:12 | class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Decl | rel: 0
 -(void)meth;
-// CHECK: [[@LINE-1]]:1 | objc-instance-method/ObjC | meth | c:objc(cs)Base(im)meth | -[Base meth] | Decl,Dyn,RelChild | rel: 1
+// 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
 @end
 
@@ -13,28 +13,28 @@ 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
   foo();
-  // CHECK: [[@LINE+3]]:6 | objc-instance-method/ObjC | meth | c:objc(cs)Base(im)meth | -[Base meth] | Ref,Call,Dyn,RelRec,RelCall | rel: 2
+  // 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-NEXT: RelRec | Base | c:objc(cs)Base
   [b meth];
 }
 
-// CHECK: [[@LINE+1]]:11 | objc-protocol/ObjC | Prot1 | c:objc(pl)Prot1 | <no-cgname> | Decl | rel: 0
+// CHECK: [[@LINE+1]]:11 | protocol/ObjC | Prot1 | c:objc(pl)Prot1 | <no-cgname> | Decl | rel: 0
 @protocol Prot1
 @end
 
-// CHECK: [[@LINE+3]]:11 | objc-protocol/ObjC | Prot2 | c:objc(pl)Prot2 | <no-cgname> | Decl | rel: 0
-// CHECK: [[@LINE+2]]:17 | objc-protocol/ObjC | Prot1 | c:objc(pl)Prot1 | <no-cgname> | Ref,RelBase | rel: 1
+// 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
 @protocol Prot2<Prot1>
 @end
 
-// CHECK: [[@LINE+7]]:12 | objc-class/ObjC | Sub | c:objc(cs)Sub | _OBJC_CLASS_$_Sub | Decl | rel: 0
-// CHECK: [[@LINE+6]]:18 | objc-class/ObjC | Base | c:objc(cs)Base | _OBJC_CLASS_$_Base | Ref,RelBase | rel: 1
+// 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 | objc-protocol/ObjC | Prot2 | c:objc(pl)Prot2 | <no-cgname> | Ref,RelBase | rel: 1
+// 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 | objc-protocol/ObjC | Prot1 | c:objc(pl)Prot1 | <no-cgname> | Ref,RelBase | rel: 1
+// 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
 @interface Sub : Base<Prot2, Prot1>
 @end
@@ -66,8 +66,8 @@ enum {
   Two,
 };
 
-// CHECK: [[@LINE+1]]:13 | typedef/C | jmp_buf | c:index-source.m at T@jmp_buf | <no-cgname> | Def | rel: 0
+// 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 | typedef/C | jmp_buf | c:index-source.m at T@jmp_buf | <no-cgname> | Ref | rel: 0
+// CHECK: [[@LINE+1]]:19 | type-alias/C | jmp_buf | c:index-source.m at T@jmp_buf | <no-cgname> | Ref | rel: 0
 extern int setjmp(jmp_buf);

Modified: cfe/trunk/tools/libclang/CXIndexDataConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXIndexDataConsumer.cpp?rev=264423&r1=264422&r2=264423&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CXIndexDataConsumer.cpp (original)
+++ cfe/trunk/tools/libclang/CXIndexDataConsumer.cpp Fri Mar 25 12:01:59 2016
@@ -1126,7 +1126,7 @@ void CXIndexDataConsumer::translateLoc(S
     *offset = FileOffset;
 }
 
-static CXIdxEntityKind getEntityKindFromSymbolKind(SymbolKind K);
+static CXIdxEntityKind getEntityKindFromSymbolKind(SymbolKind K, SymbolLanguage L);
 static CXIdxEntityCXXTemplateKind
 getEntityKindFromSymbolCXXTemplateKind(SymbolCXXTemplateKind K);
 static CXIdxEntityLanguage getEntityLangFromSymbolLang(SymbolLanguage L);
@@ -1143,7 +1143,7 @@ void CXIndexDataConsumer::getEntityInfo(
   EntityInfo.IndexCtx = this;
 
   SymbolInfo SymInfo = getSymbolInfo(D);
-  EntityInfo.kind = getEntityKindFromSymbolKind(SymInfo.Kind);
+  EntityInfo.kind = getEntityKindFromSymbolKind(SymInfo.Kind, SymInfo.Lang);
   EntityInfo.templateKind =
     getEntityKindFromSymbolCXXTemplateKind(SymInfo.TemplateKind);
   EntityInfo.lang = getEntityLangFromSymbolLang(SymInfo.Lang);
@@ -1236,40 +1236,50 @@ bool CXIndexDataConsumer::isTemplateImpl
   return false;
 }
 
-static CXIdxEntityKind getEntityKindFromSymbolKind(SymbolKind K) {
+static CXIdxEntityKind getEntityKindFromSymbolKind(SymbolKind K, SymbolLanguage Lang) {
   switch (K) {
   case SymbolKind::Unknown:
   case SymbolKind::Module:
   case SymbolKind::Macro:
+  case SymbolKind::ClassProperty:
     return CXIdxEntity_Unexposed;
 
   case SymbolKind::Enum: return CXIdxEntity_Enum;
   case SymbolKind::Struct: return CXIdxEntity_Struct;
   case SymbolKind::Union: return CXIdxEntity_Union;
-  case SymbolKind::Typedef: return CXIdxEntity_Typedef;
+  case SymbolKind::TypeAlias:
+    if (Lang == SymbolLanguage::CXX)
+      return CXIdxEntity_CXXTypeAlias;
+    return CXIdxEntity_Typedef;
   case SymbolKind::Function: return CXIdxEntity_Function;
   case SymbolKind::Variable: return CXIdxEntity_Variable;
-  case SymbolKind::Field: return CXIdxEntity_Field;
+  case SymbolKind::Field:
+    if (Lang == SymbolLanguage::ObjC)
+      return CXIdxEntity_ObjCIvar;
+    return CXIdxEntity_Field;
   case SymbolKind::EnumConstant: return CXIdxEntity_EnumConstant;
-  case SymbolKind::ObjCClass: return CXIdxEntity_ObjCClass;
-  case SymbolKind::ObjCProtocol: return CXIdxEntity_ObjCProtocol;
-  case SymbolKind::ObjCCategory: return CXIdxEntity_ObjCCategory;
-  case SymbolKind::ObjCInstanceMethod: return CXIdxEntity_ObjCInstanceMethod;
-  case SymbolKind::ObjCClassMethod: return CXIdxEntity_ObjCClassMethod;
-  case SymbolKind::ObjCProperty: return CXIdxEntity_ObjCProperty;
-  case SymbolKind::ObjCIvar: return CXIdxEntity_ObjCIvar;
-  case SymbolKind::CXXClass: return CXIdxEntity_CXXClass;
-  case SymbolKind::CXXNamespace: return CXIdxEntity_CXXNamespace;
-  case SymbolKind::CXXNamespaceAlias: return CXIdxEntity_CXXNamespaceAlias;
-  case SymbolKind::CXXStaticVariable: return CXIdxEntity_CXXStaticVariable;
-  case SymbolKind::CXXStaticMethod: return CXIdxEntity_CXXStaticMethod;
-  case SymbolKind::CXXInstanceMethod: return CXIdxEntity_CXXInstanceMethod;
-  case SymbolKind::CXXConstructor: return CXIdxEntity_CXXConstructor;
-  case SymbolKind::CXXDestructor: return CXIdxEntity_CXXDestructor;
-  case SymbolKind::CXXConversionFunction:
-    return CXIdxEntity_CXXConversionFunction;
-  case SymbolKind::CXXTypeAlias: return CXIdxEntity_CXXTypeAlias;
-  case SymbolKind::CXXInterface: return CXIdxEntity_CXXInterface;
+  case SymbolKind::Class:
+    if (Lang == SymbolLanguage::ObjC)
+      return CXIdxEntity_ObjCClass;
+    return CXIdxEntity_CXXClass;
+  case SymbolKind::Protocol:
+    if (Lang == SymbolLanguage::ObjC)
+      return CXIdxEntity_ObjCProtocol;
+    return CXIdxEntity_CXXInterface;
+  case SymbolKind::Extension: return CXIdxEntity_ObjCCategory;
+  case SymbolKind::InstanceMethod:
+    if (Lang == SymbolLanguage::ObjC)
+      return CXIdxEntity_ObjCInstanceMethod;
+    return CXIdxEntity_CXXInstanceMethod;
+  case SymbolKind::ClassMethod: return CXIdxEntity_ObjCClassMethod;
+  case SymbolKind::StaticMethod: return CXIdxEntity_CXXStaticMethod;
+  case SymbolKind::InstanceProperty: return CXIdxEntity_ObjCProperty;
+  case SymbolKind::StaticProperty: return CXIdxEntity_CXXStaticVariable;
+  case SymbolKind::Namespace: return CXIdxEntity_CXXNamespace;
+  case SymbolKind::NamespaceAlias: return CXIdxEntity_CXXNamespaceAlias;
+  case SymbolKind::Constructor: return CXIdxEntity_CXXConstructor;
+  case SymbolKind::Destructor: return CXIdxEntity_CXXDestructor;
+  case SymbolKind::ConversionFunction: return CXIdxEntity_CXXConversionFunction;
   }
   llvm_unreachable("invalid symbol kind");
 }




More information about the cfe-commits mailing list