From 8bd5a69999cfd06b6b5a58fdd04e4f802b2df5a4 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Tue, 13 Apr 2010 23:39:06 +0000 Subject: [PATCH] Add cursor kind for C++ methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101193 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang-c/Index.h | 6 +++++- tools/CIndex/CIndex.cpp | 2 ++ tools/CIndex/CXCursor.cpp | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/clang-c/Index.h b/include/clang-c/Index.h index 0ea5f2cff5..8cc538283e 100644 --- a/include/clang-c/Index.h +++ b/include/clang-c/Index.h @@ -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 */ diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index 43aa34f4cf..10c399591b 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -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: diff --git a/tools/CIndex/CXCursor.cpp b/tools/CIndex/CXCursor.cpp index cbf9d7e6f9..036214e75f 100644 --- a/tools/CIndex/CXCursor.cpp +++ b/tools/CIndex/CXCursor.cpp @@ -50,6 +50,7 @@ static CXCursorKind GetCursorKind(Decl *D) { case Decl::ObjCMethod: return cast(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; -- 2.40.0