From: Argyrios Kyrtzidis Date: Fri, 15 Jul 2011 22:37:58 +0000 (+0000) Subject: [libclang] Map canonical decl of a category implementation to the category decl. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=debb00f9ce1dd0f855d2b4fff3372b2ceeb20735;p=clang [libclang] Map canonical decl of a category implementation to the category decl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135316 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 6f001d5381..50d56fccb9 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -4142,6 +4142,10 @@ CXCursor clang_getCanonicalCursor(CXCursor C) { return C; if (Decl *D = getCursorDecl(C)) { + if (ObjCCategoryImplDecl *CatImplD = dyn_cast(D)) + if (ObjCCategoryDecl *CatD = CatImplD->getCategoryDecl()) + return MakeCXCursor(CatD, getCursorTU(C)); + if (ObjCImplDecl *ImplD = dyn_cast(D)) if (ObjCInterfaceDecl *IFD = ImplD->getClassInterface()) return MakeCXCursor(IFD, getCursorTU(C));