[libclang] Index implicit property references.
llvm-svn: 142355
diff --git a/clang/tools/libclang/IndexBody.cpp b/clang/tools/libclang/IndexBody.cpp
index b2ffb99..769a1c7 100644
--- a/clang/tools/libclang/IndexBody.cpp
+++ b/clang/tools/libclang/IndexBody.cpp
@@ -69,6 +69,21 @@
IndexCtx.handleReference(MD, E->getSelectorStartLoc(), 0, ParentDC, E);
return true;
}
+
+ bool VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
+ if (E->isImplicitProperty()) {
+ if (ObjCMethodDecl *MD = E->getImplicitPropertyGetter())
+ IndexCtx.handleReference(MD, E->getLocation(), 0, ParentDC, E,
+ CXIdxEntityRef_ImplicitProperty);
+ if (ObjCMethodDecl *MD = E->getImplicitPropertySetter())
+ IndexCtx.handleReference(MD, E->getLocation(), 0, ParentDC, E,
+ CXIdxEntityRef_ImplicitProperty);
+ } else {
+ IndexCtx.handleReference(E->getExplicitProperty(), E->getLocation(), 0,
+ ParentDC, E);
+ }
+ return true;
+ }
};
} // anonymous namespace