[cfe-commits] r85521 - /cfe/trunk/tools/CIndex/CIndex.cpp

Steve Naroff snaroff at apple.com
Thu Oct 29 11:55:51 PDT 2009


Author: snaroff
Date: Thu Oct 29 13:55:50 2009
New Revision: 85521

URL: http://llvm.org/viewvc/llvm-project?rev=85521&view=rev
Log:
clang_getDeclSpelling(): For category implementations, make sure we hand back the category name (not the class name). This fixes <rdar://problem/7297518>.


Modified:
    cfe/trunk/tools/CIndex/CIndex.cpp

Modified: cfe/trunk/tools/CIndex/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/CIndex/CIndex.cpp?rev=85521&r1=85520&r2=85521&view=diff

==============================================================================
--- cfe/trunk/tools/CIndex/CIndex.cpp (original)
+++ cfe/trunk/tools/CIndex/CIndex.cpp Thu Oct 29 13:55:50 2009
@@ -549,7 +549,10 @@
   
   if (ObjCMethodDecl *OMD = dyn_cast<ObjCMethodDecl>(ND)) {
     return OMD->getSelector().getAsString().c_str();
-  }    
+  }
+  if (ObjCCategoryImplDecl *CIMP = dyn_cast<ObjCCategoryImplDecl>(ND))
+    return CIMP->getCategoryClass()->getName().data();
+    
   if (ND->getIdentifier())
     return ND->getIdentifier()->getNameStart();
   else 





More information about the cfe-commits mailing list