[libclang] Index implicit property references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142355 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/IndexBody.cpp b/tools/libclang/IndexBody.cpp
index b2ffb99..769a1c7 100644
--- a/tools/libclang/IndexBody.cpp
+++ b/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