From: Steve Naroff Date: Thu, 29 Oct 2009 18:55:50 +0000 (+0000) Subject: clang_getDeclSpelling(): For category implementations, make sure we hand back the... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f9f6196e9fa0c41ae7422f3ebe5515e9d9707087;p=clang clang_getDeclSpelling(): For category implementations, make sure we hand back the category name (not the class name). This fixes . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85521 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/CIndex/CIndex.cpp b/tools/CIndex/CIndex.cpp index 71d76536c4..d21c6fcc70 100644 --- a/tools/CIndex/CIndex.cpp +++ b/tools/CIndex/CIndex.cpp @@ -549,7 +549,10 @@ const char *clang_getDeclSpelling(CXDecl AnonDecl) if (ObjCMethodDecl *OMD = dyn_cast(ND)) { return OMD->getSelector().getAsString().c_str(); - } + } + if (ObjCCategoryImplDecl *CIMP = dyn_cast(ND)) + return CIMP->getCategoryClass()->getName().data(); + if (ND->getIdentifier()) return ND->getIdentifier()->getNameStart(); else