]> granicus.if.org Git - clang/commitdiff
Add cursor kind for C++ methods.
authorTed Kremenek <kremenek@apple.com>
Tue, 13 Apr 2010 23:39:06 +0000 (23:39 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 13 Apr 2010 23:39:06 +0000 (23:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101193 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang-c/Index.h
tools/CIndex/CIndex.cpp
tools/CIndex/CXCursor.cpp

index 0ea5f2cff5ae7054a2c8622236e64f88a29930aa..8cc538283e9516ae9e47c11b3acbe3bc47907b4a 100644 (file)
@@ -700,7 +700,11 @@ enum CXCursorKind {
   CXCursor_ObjCCategoryImplDecl          = 19,
   /** \brief A typedef */
   CXCursor_TypedefDecl                   = 20,
-  CXCursor_LastDecl                      = 20,
+
+  /** \brief A C++ class method. */
+  CXCursor_CXXMethod                     = 21,
+
+  CXCursor_LastDecl                      = 21,
 
   /* References */
   CXCursor_FirstRef                      = 40, /* Decl references */
index 43aa34f4cfc316368cc9234aa4ff928d57fc1262..10c399591bb948d286be326bcf265aba7637118e 100644 (file)
@@ -1558,6 +1558,8 @@ CXString clang_getCursorKindSpelling(enum CXCursorKind Kind) {
       return createCXString("ObjCImplementationDecl");
   case CXCursor_ObjCCategoryImplDecl:
       return createCXString("ObjCCategoryImplDecl");
+  case CXCursor_CXXMethod:
+      return createCXString("CXXMethod");
   case CXCursor_UnexposedDecl:
       return createCXString("UnexposedDecl");
   case CXCursor_ObjCSuperClassRef:
index cbf9d7e6f9197a0061d4d0073ee38c85aed14214..036214e75f4fd4ac1df362d49cb48ff3fc7cc456 100644 (file)
@@ -50,6 +50,7 @@ static CXCursorKind GetCursorKind(Decl *D) {
     case Decl::ObjCMethod:
       return cast<ObjCMethodDecl>(D)->isInstanceMethod()
               ? CXCursor_ObjCInstanceMethodDecl : CXCursor_ObjCClassMethodDecl;
+    case Decl::CXXMethod:          return CXCursor_CXXMethod;
     case Decl::ObjCProperty:       return CXCursor_ObjCPropertyDecl;
     case Decl::ObjCProtocol:       return CXCursor_ObjCProtocolDecl;
     case Decl::ParmVar:            return CXCursor_ParmDecl;