<div dir="ltr">I'm thinking something along the lines of:<div><br></div><div><div>+  // If this is a function declaration without a body,</div><div>+  // then substitute the declaration that does have a body.</div><div>+  // (unchanged if no such definition exists)</div><div>+  FunctionDecl *SwapForDefinition(FunctionDecl *FD) {</div><div>+    FunctionDecl *Definition = FD;</div><div>+    if (! FD->doesThisDeclarationHaveABody())</div><div>+      for (auto I : FD->redecls())</div><div>+        if (I->doesThisDeclarationHaveABody())</div><div>+          Definition = I;</div><div>+</div><div>+    return Definition;</div><div>+  }</div><div>+</div><div>   void addCalledDecl(Decl *D) {</div><div>+    if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D))</div><div>+      D = SwapForDefinition(FD);</div><div>+</div><div>     if (G->includeInGraph(D)) {</div><div>       CallGraphNode *CalleeNode = G->getOrInsertNode(D);</div><div>       CallerNode->addCallee(CalleeNode, G);</div><div><br></div></div></div>