aboutsummaryrefslogtreecommitdiff
path: root/tools/CIndex/CXCursor.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-01-16 01:44:12 +0000
committerTed Kremenek <kremenek@apple.com>2010-01-16 01:44:12 +0000
commit70ee54258035c860ebc71f7e5f803b74f3186889 (patch)
tree0b65edfe584a4d15734e7405b8bb0476aa36ec72 /tools/CIndex/CXCursor.cpp
parent0b5716469b4be89adeb15a9819ac82a86ef19ca8 (diff)
Remove TranslateKind and centralize Decl -> CXCursorKind in GetCursorKind(). This revealed a bunch of inconsistencies in how CXCursorKinds were being computed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93618 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/CIndex/CXCursor.cpp')
-rw-r--r--tools/CIndex/CXCursor.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tools/CIndex/CXCursor.cpp b/tools/CIndex/CXCursor.cpp
index 00313edc45..e630445979 100644
--- a/tools/CIndex/CXCursor.cpp
+++ b/tools/CIndex/CXCursor.cpp
@@ -32,14 +32,25 @@ CXCursor cxcursor::MakeCXCursor(CXCursorKind K, Decl *D, Stmt *S) {
static CXCursorKind GetCursorKind(Decl *D) {
switch (D->getKind()) {
+ case Decl::Enum: return CXCursor_EnumDecl;
+ case Decl::EnumConstant: return CXCursor_EnumConstantDecl;
+ case Decl::Field: return CXCursor_FieldDecl;
case Decl::Function:
return cast<FunctionDecl>(D)->isThisDeclarationADefinition()
? CXCursor_FunctionDefn : CXCursor_FunctionDecl;
case Decl::ObjCCategory: return CXCursor_ObjCCategoryDecl;
case Decl::ObjCCategoryImpl: return CXCursor_ObjCCategoryDefn;
+ case Decl::ObjCClass:
+ // FIXME
+ return CXCursor_NotImplemented;
case Decl::ObjCImplementation: return CXCursor_ObjCClassDefn;
case Decl::ObjCInterface: return CXCursor_ObjCInterfaceDecl;
+ case Decl::ObjCIvar: return CXCursor_ObjCIvarDecl;
+ case Decl::ObjCMethod:
+ return cast<ObjCMethodDecl>(D)->isInstanceMethod()
+ ? CXCursor_ObjCInstanceMethodDecl : CXCursor_ObjCClassMethodDecl;
case Decl::ObjCProtocol: return CXCursor_ObjCProtocolDecl;
+ case Decl::ParmVar: return CXCursor_ParmDecl;
case Decl::Typedef: return CXCursor_TypedefDecl;
case Decl::Var: return CXCursor_VarDecl;
default: