In DeclReferenceMap, map FieldDecls to the MemberExprs that reference them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75593 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Index/DeclReferenceMap.cpp b/lib/Index/DeclReferenceMap.cpp
index 95de2ea..3ec8794 100644
--- a/lib/Index/DeclReferenceMap.cpp
+++ b/lib/Index/DeclReferenceMap.cpp
@@ -34,6 +34,7 @@
 
   void VisitDeclStmt(DeclStmt *Node);
   void VisitDeclRefExpr(DeclRefExpr *Node);
+  void VisitMemberExpr(MemberExpr *Node);
   void VisitStmt(Stmt *Node);
 };
 
@@ -69,6 +70,11 @@
   Map.insert(std::make_pair(PrimD, ASTLocation(Parent, Node)));
 }
 
+void StmtMapper::VisitMemberExpr(MemberExpr *Node) {
+  NamedDecl *PrimD = cast<NamedDecl>(Node->getMemberDecl()->getPrimaryDecl());
+  Map.insert(std::make_pair(PrimD, ASTLocation(Parent, Node)));
+}
+
 void StmtMapper::VisitStmt(Stmt *Node) {
   for (Stmt::child_iterator
          I = Node->child_begin(), E = Node->child_end(); I != E; ++I)