]> granicus.if.org Git - clang/commitdiff
clang_getDeclSpelling(): For category implementations, make sure we hand back the...
authorSteve Naroff <snaroff@apple.com>
Thu, 29 Oct 2009 18:55:50 +0000 (18:55 +0000)
committerSteve Naroff <snaroff@apple.com>
Thu, 29 Oct 2009 18:55:50 +0000 (18:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85521 91177308-0d34-0410-b5e6-96231b3b80d8

tools/CIndex/CIndex.cpp

index 71d76536c4b173751b493fd8f41fca75a63dcbd9..d21c6fcc70a48cfcf21db84a47bdba627b6c813d 100644 (file)
@@ -549,7 +549,10 @@ const char *clang_getDeclSpelling(CXDecl AnonDecl)
   
   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