From 9b9f7a9f7a44d2726abbf88d10bcfe49891b74fd Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 13 Dec 2011 18:47:45 +0000 Subject: [libclang] Indexing API: Provide the protocols list for objc categories as well. rdar://10573361 llvm-svn: 146498 --- clang/tools/libclang/IndexingContext.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/tools/libclang/IndexingContext.cpp') diff --git a/clang/tools/libclang/IndexingContext.cpp b/clang/tools/libclang/IndexingContext.cpp index 66e552c8f47..812669397d4 100644 --- a/clang/tools/libclang/IndexingContext.cpp +++ b/clang/tools/libclang/IndexingContext.cpp @@ -383,6 +383,8 @@ bool IndexingContext::handleObjCCategory(const ObjCCategoryDecl *D) { if (suppressRefs()) markEntityOccurrenceInFile(IFaceD, ClassLoc); + ObjCProtocolListInfo ProtInfo(D->getReferencedProtocols(), *this, SA); + CatDInfo.ObjCCatDeclInfo.containerInfo = &CatDInfo.ObjCContDeclInfo; if (IFaceD) { CatDInfo.ObjCCatDeclInfo.objcClass = &ClassEntity; @@ -393,6 +395,9 @@ bool IndexingContext::handleObjCCategory(const ObjCCategoryDecl *D) { CatDInfo.ObjCCatDeclInfo.classCursor = clang_getNullCursor(); } CatDInfo.ObjCCatDeclInfo.classLoc = getIndexLoc(ClassLoc); + CatDInfo.ObjCProtoListInfo = ProtInfo.getListInfo(); + CatDInfo.ObjCCatDeclInfo.protocols = &CatDInfo.ObjCProtoListInfo; + return handleObjCContainer(D, CategoryLoc, getCursor(D), CatDInfo); } @@ -416,6 +421,8 @@ bool IndexingContext::handleObjCCategoryImpl(const ObjCCategoryImplDecl *D) { CatDInfo.ObjCCatDeclInfo.classCursor = clang_getNullCursor(); } CatDInfo.ObjCCatDeclInfo.classLoc = getIndexLoc(ClassLoc); + CatDInfo.ObjCCatDeclInfo.protocols = 0; + return handleObjCContainer(D, CategoryLoc, getCursor(D), CatDInfo); } -- cgit v1.2.3