diff options
Diffstat (limited to 'clang/tools')
-rw-r--r-- | clang/tools/libclang/Indexing.cpp | 3 | ||||
-rw-r--r-- | clang/tools/libclang/IndexingContext.cpp | 7 | ||||
-rw-r--r-- | clang/tools/libclang/IndexingContext.h | 1 |
3 files changed, 11 insertions, 0 deletions
diff --git a/clang/tools/libclang/Indexing.cpp b/clang/tools/libclang/Indexing.cpp index 50c37bc51fd..630c55bb335 100644 --- a/clang/tools/libclang/Indexing.cpp +++ b/clang/tools/libclang/Indexing.cpp @@ -583,6 +583,9 @@ clang_index_getObjCProtocolRefListInfo(const CXIdxDeclInfo *DInfo) { ProtInfo = dyn_cast<ObjCProtocolDeclInfo>(DI)) return &ProtInfo->ObjCProtoRefListInfo; + if (const ObjCCategoryDeclInfo *CatInfo = dyn_cast<ObjCCategoryDeclInfo>(DI)) + return CatInfo->ObjCCatDeclInfo.protocols; + return 0; } 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); } diff --git a/clang/tools/libclang/IndexingContext.h b/clang/tools/libclang/IndexingContext.h index 1ad1d809eeb..b9234d88b3f 100644 --- a/clang/tools/libclang/IndexingContext.h +++ b/clang/tools/libclang/IndexingContext.h @@ -149,6 +149,7 @@ struct ObjCProtocolDeclInfo : public ObjCContainerDeclInfo { struct ObjCCategoryDeclInfo : public ObjCContainerDeclInfo { CXIdxObjCCategoryDeclInfo ObjCCatDeclInfo; + CXIdxObjCProtocolRefListInfo ObjCProtoListInfo; explicit ObjCCategoryDeclInfo(bool isImplementation) : ObjCContainerDeclInfo(Info_ObjCCategory, |