[libclang] When indexing an objc property, also provide information about
the getter/setter objc method entities that the property is associated with.
rdar://10244558
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151634 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/c-index-test/c-index-test.c b/tools/c-index-test/c-index-test.c
index eee7f46..925f56a 100644
--- a/tools/c-index-test/c-index-test.c
+++ b/tools/c-index-test/c-index-test.c
@@ -1809,6 +1809,7 @@
const CXIdxObjCCategoryDeclInfo *CatInfo;
const CXIdxObjCInterfaceDeclInfo *InterInfo;
const CXIdxObjCProtocolRefListInfo *ProtoInfo;
+ const CXIdxObjCPropertyDeclInfo *PropInfo;
const CXIdxCXXClassDeclInfo *CXXClassInfo;
unsigned i;
index_data = (IndexData *)client_data;
@@ -1870,6 +1871,17 @@
printProtocolList(ProtoInfo, client_data);
}
+ if ((PropInfo = clang_index_getObjCPropertyDeclInfo(info))) {
+ if (PropInfo->getter) {
+ printEntityInfo(" <getter>", client_data, PropInfo->getter);
+ printf("\n");
+ }
+ if (PropInfo->setter) {
+ printEntityInfo(" <setter>", client_data, PropInfo->setter);
+ printf("\n");
+ }
+ }
+
if ((CXXClassInfo = clang_index_getCXXClassDeclInfo(info))) {
for (i = 0; i != CXXClassInfo->numBases; ++i) {
printBaseClassInfo(client_data, CXXClassInfo->bases[i]);