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

llvm-svn: 75593
This commit is contained in:
Argyrios Kyrtzidis 2009-07-14 03:18:09 +00:00
parent 664b690107
commit a28d145cbb
1 changed files with 6 additions and 0 deletions

View File

@ -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<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)