clang_getDeclSpelling(): For category implementations, make sure we hand back the category name (not the class name). This fixes <rdar://problem/7297518>.

llvm-svn: 85521
This commit is contained in:
Steve Naroff 2009-10-29 18:55:50 +00:00
parent 0d07eb32de
commit a4aeed6958
1 changed files with 4 additions and 1 deletions

View 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