- Add/tweak some comments.
- change ObjCCategoryImplDecl::getCategoryClass() to getCategoryDecl().

No functionality change.

llvm-svn: 85528
diff --git a/clang/tools/CIndex/CIndex.cpp b/clang/tools/CIndex/CIndex.cpp
index d21c6fc..4798e28 100644
--- a/clang/tools/CIndex/CIndex.cpp
+++ b/clang/tools/CIndex/CIndex.cpp
@@ -551,7 +551,10 @@
     return OMD->getSelector().getAsString().c_str();
   }
   if (ObjCCategoryImplDecl *CIMP = dyn_cast<ObjCCategoryImplDecl>(ND))
-    return CIMP->getCategoryClass()->getName().data();
+    // No, this isn't the same as the code below. getIdentifier() is non-virtual
+    // and returns different names. NamedDecl returns the class name and
+    // ObjCCategoryImplDecl returns the category name.
+    return CIMP->getIdentifier()->getNameStart();
     
   if (ND->getIdentifier())
     return ND->getIdentifier()->getNameStart();