From a28d145cbb399f9bff5010998aa878a9a91b119a Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 14 Jul 2009 03:18:09 +0000 Subject: [PATCH] In DeclReferenceMap, map FieldDecls to the MemberExprs that reference them. llvm-svn: 75593 --- clang/lib/Index/DeclReferenceMap.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clang/lib/Index/DeclReferenceMap.cpp b/clang/lib/Index/DeclReferenceMap.cpp index 95de2ea7d0a3..3ec8794b379b 100644 --- a/clang/lib/Index/DeclReferenceMap.cpp +++ b/clang/lib/Index/DeclReferenceMap.cpp @@ -34,6 +34,7 @@ public: void VisitDeclStmt(DeclStmt *Node); void VisitDeclRefExpr(DeclRefExpr *Node); + void VisitMemberExpr(MemberExpr *Node); void VisitStmt(Stmt *Node); }; @@ -69,6 +70,11 @@ void StmtMapper::VisitDeclRefExpr(DeclRefExpr *Node) { Map.insert(std::make_pair(PrimD, ASTLocation(Parent, Node))); } +void StmtMapper::VisitMemberExpr(MemberExpr *Node) { + NamedDecl *PrimD = cast(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)