And libclang cursor/indexing support for new Objective-C NSArray/NSDictionary/NSNumber literals.

llvm-svn: 152138
diff --git a/clang/tools/libclang/IndexBody.cpp b/clang/tools/libclang/IndexBody.cpp
index cce0bf7..74a8d37 100644
--- a/clang/tools/libclang/IndexBody.cpp
+++ b/clang/tools/libclang/IndexBody.cpp
@@ -81,17 +81,33 @@
   }
 
   bool VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) {
-    if (E->isImplicitProperty()) {
-      if (ObjCMethodDecl *MD = E->getImplicitPropertyGetter())
-        IndexCtx.handleReference(MD, E->getLocation(), Parent, ParentDC, E,
-                                 CXIdxEntityRef_Implicit);
-      if (ObjCMethodDecl *MD = E->getImplicitPropertySetter())
-        IndexCtx.handleReference(MD, E->getLocation(), Parent, ParentDC, E,
-                                 CXIdxEntityRef_Implicit);
-    } else {
+    if (E->isExplicitProperty())
       IndexCtx.handleReference(E->getExplicitProperty(), E->getLocation(),
                                Parent, ParentDC, E);
-    }
+
+    // No need to do a handleReference for the objc method, because there will
+    // be a message expr as part of PseudoObjectExpr.
+    return true;
+  }
+
+  bool VisitObjCNumericLiteral(ObjCNumericLiteral *E) {
+    if (ObjCMethodDecl *MD = E->getObjCNumericLiteralMethod())
+      IndexCtx.handleReference(MD, E->getLocStart(),
+                               Parent, ParentDC, E, CXIdxEntityRef_Implicit);
+    return true;
+  }
+
+  bool VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) {
+    if (ObjCMethodDecl *MD = E->getDictWithObjectsMethod())
+      IndexCtx.handleReference(MD, E->getLocStart(),
+                               Parent, ParentDC, E, CXIdxEntityRef_Implicit);
+    return true;
+  }
+
+  bool VisitObjCArrayLiteral(ObjCArrayLiteral *E) {
+    if (ObjCMethodDecl *MD = E->getArrayWithObjectsMethod())
+      IndexCtx.handleReference(MD, E->getLocStart(),
+                               Parent, ParentDC, E, CXIdxEntityRef_Implicit);
     return true;
   }