aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/CallGraph.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/CallGraph.cpp')
-rw-r--r--lib/Analysis/CallGraph.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Analysis/CallGraph.cpp b/lib/Analysis/CallGraph.cpp
index d49e8ec11b..2ec6d2014d 100644
--- a/lib/Analysis/CallGraph.cpp
+++ b/lib/Analysis/CallGraph.cpp
@@ -69,7 +69,10 @@ void CGBuilder::VisitCallExpr(CallExpr *CE) {
if (FunctionDecl *CalleeDecl = CE->getDirectCallee()) {
Entity *Ent = Entity::get(CalleeDecl, G.getProgram());
CallGraphNode *CalleeNode = G.getOrInsertFunction(Ent);
- CallerNode->addCallee(ASTLocation(FD, CE), CalleeNode);
+
+ Decl *Parent = ASTLocation::FindImmediateParent(FD, CE);
+
+ CallerNode->addCallee(ASTLocation(Parent, CE), CalleeNode);
}
}