And libclang cursor/indexing support for new Objective-C NSArray/NSDictionary/NSNumber literals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152138 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/IndexBody.cpp b/tools/libclang/IndexBody.cpp
index cce0bf7..74a8d37 100644
--- a/tools/libclang/IndexBody.cpp
+++ b/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;
}