[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 6f001d5..50d56fc 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -4142,6 +4142,10 @@
return C;
if (Decl *D = getCursorDecl(C)) {
+ if (ObjCCategoryImplDecl *CatImplD = dyn_cast<ObjCCategoryImplDecl>(D))
+ if (ObjCCategoryDecl *CatD = CatImplD->getCategoryDecl())
+ return MakeCXCursor(CatD, getCursorTU(C));
+
if (ObjCImplDecl *ImplD = dyn_cast<ObjCImplDecl>(D))
if (ObjCInterfaceDecl *IFD = ImplD->getClassInterface())
return MakeCXCursor(IFD, getCursorTU(C));