aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/IndexingContext.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-02-28 17:50:33 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-02-28 17:50:33 +0000
commit792db266f3d2f12a7a16bf37d90074f54bca1e6f (patch)
treedc0c02223c305d3364c0eb213ebc1b11127f843f /tools/libclang/IndexingContext.cpp
parentd7c15a64ba8ebdca0dd48dd1d2f233107d34494e (diff)
[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
Diffstat (limited to 'tools/libclang/IndexingContext.cpp')
-rw-r--r--tools/libclang/IndexingContext.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/tools/libclang/IndexingContext.cpp b/tools/libclang/IndexingContext.cpp
index 2963f3b945..6797cc244a 100644
--- a/tools/libclang/IndexingContext.cpp
+++ b/tools/libclang/IndexingContext.cpp
@@ -517,8 +517,26 @@ bool IndexingContext::handleSynthesizedObjCMethod(const ObjCMethodDecl *D,
}
bool IndexingContext::handleObjCProperty(const ObjCPropertyDecl *D) {
- DeclInfo DInfo(/*isRedeclaration=*/false, /*isDefinition=*/false,
- /*isContainer=*/false);
+ ObjCPropertyDeclInfo DInfo;
+ EntityInfo GetterEntity;
+ EntityInfo SetterEntity;
+ ScratchAlloc SA(*this);
+
+ DInfo.ObjCPropDeclInfo.declInfo = &DInfo;
+
+ if (ObjCMethodDecl *Getter = D->getGetterMethodDecl()) {
+ getEntityInfo(Getter, GetterEntity, SA);
+ DInfo.ObjCPropDeclInfo.getter = &GetterEntity;
+ } else {
+ DInfo.ObjCPropDeclInfo.getter = 0;
+ }
+ if (ObjCMethodDecl *Setter = D->getSetterMethodDecl()) {
+ getEntityInfo(Setter, SetterEntity, SA);
+ DInfo.ObjCPropDeclInfo.setter = &SetterEntity;
+ } else {
+ DInfo.ObjCPropDeclInfo.setter = 0;
+ }
+
return handleDecl(D, D->getLocation(), getCursor(D), DInfo);
}